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 



------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to