Discussion:
[Matlab-emacs-discuss] matlab-shell should be able to change the directory, when needed
Uwe Brauer
2012-02-28 19:31:20 UTC
Permalink
Hello

The following works in windows. I use the built in editor
and when to run the entire file, however the command shell
is in a different directory. Then a windows pop up telling
me this and offering me: either to add the current directory
to the path or to change the command window prompt to the
directory of the file, which is the option I almost ever
chose.

I thought that might not to difficult but then as a starter
I cannot find a variable which tells me in which directory I
started the matlab-shell.

Uwe Brauer
Uwe Brauer
2012-02-28 19:59:28 UTC
Permalink
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
Sylvain Rousseau
2012-02-29 11:00:33 UTC
Permalink
Hello,

try the following patch:

http://sourceforge.net/tracker/?func=detail&aid=3468931&group_id=154105&atid=790448

Sylvain.
Uwe Brauer
2012-02-29 13:28:17 UTC
Permalink
Post by Sylvain Rousseau
Hello,
http://sourceforge.net/tracker/?func=detail&aid=3468931&group_id=154105&atid=790448
Sylvain.
Hello,
http://sourceforge.net/tracker/?func=detail&aid=3468931&group_id=154105&atid=790448
very nice!!!
Thanks!
However I would recommend to have the variable
matlab-change-current-directory set to t per default.

Uwe
Uwe Brauer
2016-02-09 17:08:32 UTC
Permalink
Hi Sylvian,
Post by Sylvain Rousseau
Hello,
http://sourceforge.net/tracker/?func=detail&aid=3468931&group_id=
154105&atid=790448
Sylvain.
Are you the author of that patch?

Thanks

Uwe Brauer
Cayetano Santos
2016-02-09 17:18:59 UTC
Permalink
By the way, I guess the el-get recipe below should be updated too

https://github.com/dimitri/el-get/blob/master/recipes/matlab-mode.rcp

--

Cayetano Santos
Post by Uwe Brauer
Hi Sylvian,
Post by Sylvain Rousseau
Hello,
http://sourceforge.net/tracker/?func=detail&aid=3468931&group_id=
154105&atid=790448
Sylvain.
Are you the author of that patch?
Thanks
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=272487151&iu=/4140
_______________________________________________
Matlab-emacs-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss
Sylvain Rousseau
2016-02-10 20:45:24 UTC
Permalink
Hi Uwe,

Indeed I am!
Post by Uwe Brauer
Hi Sylvian,
Post by Sylvain Rousseau
Hello,
http://sourceforge.net/tracker/?func=detail&aid=3468931&group_id=
154105&atid=790448
Sylvain.
Are you the author of that patch?
Thanks
Uwe Brauer
Uwe Brauer
2016-02-11 10:05:31 UTC
Permalink
Post by Sylvain Rousseau
Hi Uwe,
Indeed I am!
Hi Sylvain,

Thanks for clarifying. I will see how to mention you authorship.

Uwe

Loading...