From: Tristan N. <tri...@gm...> - 2013-12-02 14:45:46
|
Hi, great tool! I was wondering if it's possible to connect to a running matlab session and designate it as the current *matlab* M-shell? I am running a remote (ssh) matlab, which works by editing the matlab.el matlab-shell command to an ssh script. However, it would be most amazing if I could connect to an already running matlab process (in the background on the server) via terminal, and then just 'make' that shell my current matlab shell in emacs, with something like 'matlab-shell-mode'. Also, it would be great to be able to have an interactive matlab-shell with default 'matlab' as command, but the possibility to change that command, so to be able to launch remote matlabs without having to change matlab.el every time... Maybe that would even elegantly solve the above process by using a command that just connects to the running matlab and puts it to the foreground? I wouldnt mind doing that manually with a bash command. Any chances to integrate that? cheers, Tristan |
From: L. L. S. <ls...@gm...> - 2013-12-02 15:39:44
|
Hi, On your remote system, start emacs in daemon mode. Then start matlab shell. Then, you can connect to you emacs and thus your matlab-shell via the emacsclient command any time. Emacs stays up, matlab stays up. Plus you can move from machine to machine and always connect to your original matlab session. I *think* this is what you want? You can do something similar with your local emacs and tramp. If you are sitting on a remote filesystem (M-x cd remote_file_system) and then M-x shell, you can start matlab up from that shell and it won't go away. But, that shell is not a "matlab-shell". Larrabee On Dec 2, 2013, at 9:45 AM, Tristan Nakagawa wrote: > Hi, great tool! > > I was wondering if it's possible to connect to a running matlab session > and designate it as the current *matlab* M-shell? > > I am running a remote (ssh) matlab, which works by editing the matlab.el > matlab-shell command to an ssh script. > > However, it would be most amazing if I could connect to an already > running matlab process (in the background on the server) via terminal, > and then just 'make' that shell my current matlab shell in emacs, with > something like 'matlab-shell-mode'. > > Also, it would be great to be able to have an interactive matlab-shell > with default 'matlab' as command, but the possibility to change that > command, so to be able to launch remote matlabs without having to change > matlab.el every time... > Maybe that would even elegantly solve the above process by using a > command that just connects to the running matlab and puts it to the > foreground? I wouldnt mind doing that manually with a bash command. > > Any chances to integrate that? > > cheers, > > Tristan > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss ---------------------------------------- L. Larrabee Strow Physics Department UMBC Email: st...@um... Office: 724-663-7341 Google Voice: 724-663-1441 Cell: 724-288-6933 (usually OFF) (Please use Office/GVoice for messages) |
From: Tristan N. <tri...@gm...> - 2013-12-02 16:24:16
|
Hi, thanks for the answers, @Larrabee: the first one really isn't what I want since I want to use my local emacs with local scripting files, being the newest version with org-babel integration etc, to interact with the remote, detachable matlab. This would be much easier than to potentially periodically ask administrator to update the emacs installations and/or update the configuration on various servers myself, and having problems with keys not being sent right (e.g. Capslock -> Ctrl). And I haven't quite figured out how to use tramp (except if it runs anyways in the background and its the default matlab via ssh in emacs terminal-emulator solution), but the whole Idea is to have it interact with my script as *Matlab* in matlab-shell mode anyways. @Stefan: That does work beautifully and simply. and with the ansi-term is even better! I just fought with not being able to run tmux in emacs term or shell, and didn't know about ansi-term now I can do, to start my session with local script and remote matlab: M-x ansi-term TERM=screen ssh server M-x rename-buffer RET *MATLAB* tmux matlab When done, distach Matlab by tmux command: C-b d Now I can close everything, and reconnect with the same procedure as before, only this time using: tmux attach , and my matlab is still open. Awesome! I will worry about a function for all this another time, great to have it working! Thanks! and @Larrabee: No, for me the commands work fine, only if there is already a character given on the command prompt it doesn't ignore it but adds it to the command from the other buffer, resulting in an error cheers T On 2013-12-02 16:39, L. Larrabee Strow wrote: > Hi, > > On your remote system, start emacs in daemon mode. Then start matlab shell. Then, you can connect to you emacs and thus your matlab-shell via the emacsclient command any time. Emacs stays up, matlab stays up. Plus you can move from machine to machine and always connect to your original matlab session. I *think* this is what you want? > > You can do something similar with your local emacs and tramp. If you are sitting on a remote filesystem (M-x cd remote_file_system) and then M-x shell, you can start matlab up from that shell and it won't go away. But, that shell is not a "matlab-shell". > > Larrabee > > On Dec 2, 2013, at 9:45 AM, Tristan Nakagawa wrote: > >> Hi, great tool! >> >> I was wondering if it's possible to connect to a running matlab session >> and designate it as the current *matlab* M-shell? >> >> I am running a remote (ssh) matlab, which works by editing the matlab.el >> matlab-shell command to an ssh script. >> >> However, it would be most amazing if I could connect to an already >> running matlab process (in the background on the server) via terminal, >> and then just 'make' that shell my current matlab shell in emacs, with >> something like 'matlab-shell-mode'. >> >> Also, it would be great to be able to have an interactive matlab-shell >> with default 'matlab' as command, but the possibility to change that >> command, so to be able to launch remote matlabs without having to change >> matlab.el every time... >> Maybe that would even elegantly solve the above process by using a >> command that just connects to the running matlab and puts it to the >> foreground? I wouldnt mind doing that manually with a bash command. >> >> Any chances to integrate that? >> >> cheers, >> >> Tristan >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > > > ---------------------------------------- > L. Larrabee Strow > Physics Department > UMBC > Email: st...@um... > Office: 724-663-7341 > Google Voice: 724-663-1441 > Cell: 724-288-6933 (usually OFF) > (Please use Office/GVoice for messages) > |
From: Stefan H. <st...@gm...> - 2013-12-02 15:45:02
|
Hi there, On 02.12.2013, at 15:45, Tristan Nakagawa <tri...@gm...> wrote: > Hi, great tool! > > I was wondering if it's possible to connect to a running matlab session > and designate it as the current *matlab* M-shell? > > I am running a remote (ssh) matlab, which works by editing the matlab.el > matlab-shell command to an ssh script. > > However, it would be most amazing if I could connect to an already > running matlab process (in the background on the server) via terminal, > and then just 'make' that shell my current matlab shell in emacs, with > something like 'matlab-shell-mode'. All you have to to do is to rename the buffer to *MATLAB*. Then it behaves like the matlab-shell, i.e. you can send code from matlab code buffers, etc. You could use "rename-buffer", i.e. "M-x rename-buffer", or use the following function (put the following code into ".emacs.d/init.el"). Restart your emacs and then "M-x rename-matlab". (defun rename-matlab () "Renames the current buffer to *MATLAB*. Useful when running several matlabs." (interactive) (rename-buffer "*MATLAB*") ) > Also, it would be great to be able to have an interactive matlab-shell > with default 'matlab' as command, but the possibility to change that > command, so to be able to launch remote matlabs without having to change > matlab.el every time... > Maybe that would even elegantly solve the above process by using a > command that just connects to the running matlab and puts it to the > foreground? I wouldnt mind doing that manually with a bash command. Not completely sure how to do that. I don't think that the matlab-mode must be changed for that. Instead, you have to figure out how to create an emacs command that creates a new buffer e.g. for an 'ansi-term', then does ssh somewhere, and starts matlab. Finally you rename the buffer to "*MATLAB*", that's it! Possibly the people at http://stackoverflow.com/ can help you with writing the necessary elisp code. I would be also interested in such a emacs command. Best wishes, Stefan. > Any chances to integrate that? > > cheers, > > Tristan > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |
From: L. L. S. <ls...@gm...> - 2013-12-02 16:20:08
|
All, I just tried renaming a *shell* buffer running Matlab to *MATLAB*. It kinda works, but not completely. "Run Region" for example, works, but inserts an extra ">" prompt that must be removed by hand, unlike a buffer actually created by "matlab-shell". Am I missing something? Thanks, Larrabee On Dec 2, 2013, at 10:44 AM, Stefan Harmeling wrote: > Hi there, > > On 02.12.2013, at 15:45, Tristan Nakagawa <tri...@gm...> wrote: > >> Hi, great tool! >> >> I was wondering if it's possible to connect to a running matlab session >> and designate it as the current *matlab* M-shell? >> >> I am running a remote (ssh) matlab, which works by editing the matlab.el >> matlab-shell command to an ssh script. >> >> However, it would be most amazing if I could connect to an already >> running matlab process (in the background on the server) via terminal, >> and then just 'make' that shell my current matlab shell in emacs, with >> something like 'matlab-shell-mode'. > > All you have to to do is to rename the buffer to *MATLAB*. Then it behaves like the matlab-shell, i.e. you can send code from matlab code buffers, etc. You could use "rename-buffer", i.e. "M-x rename-buffer", or use the following function (put the following code into ".emacs.d/init.el"). Restart your emacs and then "M-x rename-matlab". > > (defun rename-matlab () > "Renames the current buffer to *MATLAB*. Useful when running several matlabs." > (interactive) > (rename-buffer "*MATLAB*") > ) > >> Also, it would be great to be able to have an interactive matlab-shell >> with default 'matlab' as command, but the possibility to change that >> command, so to be able to launch remote matlabs without having to change >> matlab.el every time... >> Maybe that would even elegantly solve the above process by using a >> command that just connects to the running matlab and puts it to the >> foreground? I wouldnt mind doing that manually with a bash command. > > Not completely sure how to do that. I don't think that the matlab-mode must be changed for that. Instead, you have to figure out how to create an emacs command that creates a new buffer e.g. for an 'ansi-term', then does ssh somewhere, and starts matlab. Finally you rename the buffer to "*MATLAB*", that's it! Possibly the people at http://stackoverflow.com/ can help you with writing the necessary elisp code. I would be also interested in such a emacs command. > > Best wishes, > Stefan. > >> Any chances to integrate that? >> >> cheers, >> >> Tristan >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss ---------------------------------------- L. Larrabee Strow Physics Department UMBC Email: st...@um... Office: 724-663-7341 Google Voice: 724-663-1441 Cell: 724-288-6933 (usually OFF) (Please use Office/GVoice for messages) |