Dear Uwe Maybe I misunderstand the problem. If I make sure the diectories are on the search path using e.g. addpath and maybe genpath I have no problems when running m-files from different directories using
matlab-mode, version 3.3.2 GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian Associate Prof. Ph.D Torben Knudsen Mobile : (+45) 2787 9826 Section of Automation and Control, Department of Electronic Systems, Email : t...@es.aau.dk Aalborg University Web : es.aau.dk/staff/tk Fredrik Bajersvej 7 DK-9220 Aalborg Ø Denmark ________________________________________ Fra: Uwe Brauer [o...@mat.ucm.es] Sendt: 23. januar 2016 19:41 Til: matlab-emacs Emne: [Matlab-emacs-discuss] execute matlab in a different directory. GNU vs Xemacs Hi Here is the scenario. - I open a matlab file in dir1, - start the matlab shell, - open a matlab file in dir2, now I cannot run matlab directly but have to change the shell: In xemacs the following code worked (defun matlab-cd-dir-actual () (interactive) (setq saved-default-directory default-directory) (matlab-shell-run-command (concat "cd " (file-name-directory (buffer-file-name)))) (message (concat "*MATLAB* (& lisp) dir: " (default-directory))) (setq command-line-default-directory (file-name-directory (buffer-file-name))) (cd (file-name-directory (buffer-file-name))) (setq default-directory saved-default-directory) (message (concat "Xemacs dir should be: " (default-directory)))) But in GNU emacs it does not, because of default-directory which is a function in xemacs but not in GNU emacs and I don't want to import all the code from the Xemacs dired version to GNU emacs. Anybody has a better solution, that actually works in GNU emacs Regards Uwe Brauer ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Matlab-emacs-discuss mailing list Matlab-emacs-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ Matlab-emacs-discuss mailing list Matlab-emacs-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss