From: Uwe B. <ou...@ma...> - 2015-06-24 08:09:26
|
Hello Here is the scenario (usually happens when I correct a bunch of matlab files in different directories). Dir1 contains 3 matlab files dir2 contains 3 matlab files I open one file in dir1 and execute the code for example via matlab-shell-save-and-go I do the same with the other files but then I change to dir2 and open the first file: when I now execute the code it sometimes does not run, since the matlab-shell presumes it is still in dir 1. So I execute the following hack. (defun matlab-cd-dir-actual () (interactive) (matlab-shell-run-command (concat "cd " (file-name-directory (buffer-file-name)))) (message (concat "*MATLAB* (& lisp) dir: " (default-directory))) (setq default-directory (file-name-directory (buffer-file-name)))) So far so good. However when I switch to the matlab-shell and want to open a file via find-file Then (X)emacs still seems to think that I am in dir1 and offers ~/matlabfiles/dir1 Instead of ~/matlabfiles/dir2 When I execute pwd in the matlab-shell I receive ans= /home/oub/matlabfiles/dir2 As it should be. So maybe this is more a question of (X)emacs, but why does my function not work as expected. Thanks Uwe Brauer |