From: Uwe B. <ou...@ma...> - 2012-02-28 19:59:40
|
>> On Tue, 28 Feb 2012 20:48:37 +0100, evelina dineva <ed...@de...> wrote: > try the command >> pwd > in the shell to see in which directory it currently is open works on > OSX/linux; not sure about windows yes of course, but then I have still to change the directory manually. That is: my *MATLAB* shell is in dir1, I have a matlab file at hand (which is in dir2) and run `matlab-shell-save-and-go' but it does not work because this file is in a different directory. As I said in MS windows a window pops up. Now in linux I have to switch to the matlab-shell run pwd and then run cd dir2. That is very cumbersome. So I came up with the following solution which I can fire up in the file (defun matlab-cd-dir-actual () (interactive) (matlab-shell-run-command (concat "cd " (file-name-directory (buffer-file-name)))) (message "You have changed the *MATLAB* shell to the current directory.")) This function is sort of overkill it is executed always, better would be to have a variable which checks whether the file is in the directory where the *MATLAB* shell runs. Uwe Brauer |