Uwe Brauer
2017-02-24 16:57:23 UTC
Hi all
I find the following quite annoying and look desperately for a solution.
I am using the following structure
Dir-Matlab/dir1/test.m
Dir-Matlab/dir2/test2.m
Now I open test.m and run matlab-shell-save-and-go
I see
>> cd(['/home/oub/ALLES/Dir-Matlab/dir1/'])
>> test
y = 64
Which is ok, so I open test2.m in dir2 and do the same, again the shall
does it nicely
>> cd(['/home/oub/ALLES/Dir-Matlab/dir2/'])
>> test2
y = 49
And indeed
>> pwd
tells me
/home/oub/ALLES/Dir-Matlab/dir2
Which is ok.
However when I use find-file, in the *MATLAB* shell, then the buffer of
the matlab shell thinks that I am still in dir1.
Find file: ~/ALLES/Dir-Matlab/dir1/
How can I tell the buffer that I am running that I am in the dir2?
Or in other words
>> cd(['/home/oub/ALLES/Dir-Matlab/dir2/'])
should be reflected in the *MATLAB* buffer
Anybody has an idea how to achieve that?
The only idea which occurred to me is this function
(defun my-matlab-switch-and-save-default-directory ()
(interactive)
(let ((saved-default-directory default-directory))
(switch-to-buffer "*MATLAB*")
(setq default-directory saved-default-directory)))
Which should somehow be included in matlab-shell-save-and-go, any
suggestions?
Regards
Uwe Brauer
I find the following quite annoying and look desperately for a solution.
I am using the following structure
Dir-Matlab/dir1/test.m
Dir-Matlab/dir2/test2.m
Now I open test.m and run matlab-shell-save-and-go
I see
>> cd(['/home/oub/ALLES/Dir-Matlab/dir1/'])
>> test
y = 64
Which is ok, so I open test2.m in dir2 and do the same, again the shall
does it nicely
>> cd(['/home/oub/ALLES/Dir-Matlab/dir2/'])
>> test2
y = 49
And indeed
>> pwd
tells me
/home/oub/ALLES/Dir-Matlab/dir2
Which is ok.
However when I use find-file, in the *MATLAB* shell, then the buffer of
the matlab shell thinks that I am still in dir1.
Find file: ~/ALLES/Dir-Matlab/dir1/
How can I tell the buffer that I am running that I am in the dir2?
Or in other words
>> cd(['/home/oub/ALLES/Dir-Matlab/dir2/'])
should be reflected in the *MATLAB* buffer
Anybody has an idea how to achieve that?
The only idea which occurred to me is this function
(defun my-matlab-switch-and-save-default-directory ()
(interactive)
(let ((saved-default-directory default-directory))
(switch-to-buffer "*MATLAB*")
(setq default-directory saved-default-directory)))
Which should somehow be included in matlab-shell-save-and-go, any
suggestions?
Regards
Uwe Brauer