From: Guangran K. Z. <gua...@ma...> - 2010-12-30 18:11:44
|
Dear all, I am configuring matlab-emacs with Ubuntu 10.4, Emacs 23 CEDET-1.0pre7 MATLAB r2010a I intent to run Matlab within emacs through "matlab-shell". Currently, this command runs successfully. However, when I type "edit", nothing happens on the command prompt and there is no buffer created for the new file. I could not find any error message and matlab prompt is ==================================================== < M A T L A B (R) > Copyright 1984-2010 The MathWorks, Inc. Version 7.10.0.499 (R2010a) 64-bit (glnxa64) February 5, 2010 To get started, type one of these: helpwin, helpdesk, or demo. For product information, visit www.mathworks.com. >> addpath('/home/kzhu/devcode/matlab-emacs/toolbox','-begin'); rehash; emacsinit('emacsclient -n'); >> edit >> ==================================================== There is no "emacsclient" installed on my machine. Given the "addpath ..." command run at startup, I suspect that there is some configuration missing to link the matlab to the current emacs. Any comment on how to debug this problem? Thank you. -- Sincerely yours, Kevin Guangran Zhu (PhD Candidate) Computational Electromagnetics Lab McGill University Montreal, Canada Tel: 1-514-398-1533 |
From: Daniel <sn...@gm...> - 2011-01-01 14:43:25
|
You could replace the line > clientcommand = 'emacsclient -n'; in the file 'emacsinit.m', which is located in '/home/kzhu/devcode/matlab-emacs/toolbox', by > clientcommand = 'emacs'; But in this case each time you call edit, the file will be opened in a new emacs process, which is pretty useless when you want to use matlab-emacs. As far as I know the only possibility is to use emacsclient and add > (server-start) in your .emacs file. On Thu, Dec 30, 2010 at 6:59 PM, Guangran Kevin Zhu <gua...@ma...> wrote: > Dear all, > > I am configuring matlab-emacs with > > Ubuntu 10.4, > Emacs 23 > CEDET-1.0pre7 > MATLAB r2010a > > I intent to run Matlab within emacs through "matlab-shell". Currently, > this command runs successfully. However, when I type "edit", nothing > happens on the command prompt and there is no buffer created for the new > file. I could not find any error message and matlab prompt is > > ==================================================== > < M A T L A B (R) > > Copyright 1984-2010 The MathWorks, Inc. > Version 7.10.0.499 (R2010a) 64-bit (glnxa64) > February 5, 2010 > > > To get started, type one of these: helpwin, helpdesk, or demo. > For product information, visit www.mathworks.com. > > >> addpath('/home/kzhu/devcode/matlab-emacs/toolbox','-begin'); rehash; > emacsinit('emacsclient -n'); > >> edit > >> > > ==================================================== > > There is no "emacsclient" installed on my machine. Given the "addpath > ..." command run at startup, I suspect that there is some configuration > missing to link the matlab to the current emacs. > > Any comment on how to debug this problem? Thank you. > > > -- > Sincerely yours, > > Kevin Guangran Zhu (PhD Candidate) > Computational Electromagnetics Lab > McGill University > Montreal, Canada > Tel: 1-514-398-1533 > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > |
From: Dineva, E. E <eve...@ui...> - 2011-01-01 16:33:36
|
I think one also need to tell matlab to use emacs as default editor one can do this via the matlab settings. sorry, do not have my Ubuntu at hand to look up details; on mac it's via preferences when you have a malab window open. e.g., calling 'doc edit' via the matlab-shell has Preference settings under the File menu 'doc edit' provides some info on setting up an alternative editor with the -nodisplay startup option unfortunately this does not work for aquamacs on the mac; but similar settings were just fine on ubuntu with (regular, snapshot) emacs hope this helps a bit and a Happy New Year! evelina On Jan 1, 2011, at 9:43 AM, Daniel wrote: > You could replace the line >> clientcommand = 'emacsclient -n'; > in the file 'emacsinit.m', which is located in > '/home/kzhu/devcode/matlab-emacs/toolbox', by >> clientcommand = 'emacs'; > > But in this case each time you call edit, the file will be opened in a > new emacs process, which is pretty useless when you want to use > matlab-emacs. > As far as I know the only possibility is to use emacsclient and add >> (server-start) > in your .emacs file. > > > On Thu, Dec 30, 2010 at 6:59 PM, Guangran Kevin Zhu > <gua...@ma...> wrote: >> Dear all, >> >> I am configuring matlab-emacs with >> >> Ubuntu 10.4, >> Emacs 23 >> CEDET-1.0pre7 >> MATLAB r2010a >> >> I intent to run Matlab within emacs through "matlab-shell". Currently, >> this command runs successfully. However, when I type "edit", nothing >> happens on the command prompt and there is no buffer created for the new >> file. I could not find any error message and matlab prompt is >> >> ==================================================== >> < M A T L A B (R) > >> Copyright 1984-2010 The MathWorks, Inc. >> Version 7.10.0.499 (R2010a) 64-bit (glnxa64) >> February 5, 2010 >> >> >> To get started, type one of these: helpwin, helpdesk, or demo. >> For product information, visit www.mathworks.com. >> >> >> addpath('/home/kzhu/devcode/matlab-emacs/toolbox','-begin'); rehash; >> emacsinit('emacsclient -n'); >> >> edit >> >> >> >> ==================================================== >> >> There is no "emacsclient" installed on my machine. Given the "addpath >> ..." command run at startup, I suspect that there is some configuration >> missing to link the matlab to the current emacs. >> >> Any comment on how to debug this problem? Thank you. >> >> >> -- >> Sincerely yours, >> >> Kevin Guangran Zhu (PhD Candidate) >> Computational Electromagnetics Lab >> McGill University >> Montreal, Canada >> Tel: 1-514-398-1533 >> >> ------------------------------------------------------------------------------ >> Learn how Oracle Real Application Clusters (RAC) One Node allows customers >> to consolidate database storage, standardize their database environment, and, >> should the need arise, upgrade to a full multi-node Oracle RAC database >> without downtime or disruption >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss >> > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |
From: Daniel <sn...@gm...> - 2011-01-01 20:54:57
|
Please ignore my proposal about editing the emacsinit.m. This is nonsense, sorry. > emascsinit('emacs') Is equivalent to setting the Editor/Debugger in your matlab Preferences. You can place this in your startup.m file, but it won't help since it will always open a new process. I think the best way is to install an emacs version that comes with emacsclient (are you sure that your emacs on ubuntu has no emacsclient?). There is also an other advantage to use emacsclient. for e.g. in your .bashrc > alias "edit=emacsclient -n -a emacs" With this you can type 'edit somefile.txt' in a console and it will open the file in your existing emacs process, if there is one, otherwise it will start one. Don't forget to add (server-start) in your emacs config file. |
From: Guangran K. Z. <gua...@ma...> - 2011-01-01 21:38:50
|
Thank you for the pointer. Using emacsclient does not support the debugging and code evaluation, which I have relied on heavily. changing ~/X11/app-defaults/Matlab *externalEditorCommand: $EDITOR $FILE & does not provide the debugging and evaluation support as well. Thus, using emacs-shell, to the best of my knowledge, is my only option. I followed the documentation http://blogs.mathworks.com/desktop/2009/09/14/matlab-emacs-integration-is-back/ Currently, I am missing on the configuration of linking the matlab invoked in the buffer back to the current emacs session. In the meantime, I experimented with the matlab-shell. In comparison with invoking the following on a command line, $ matlab -nodesktop -nosplash I found matlab-shell is nice to use, as I could edit the command in the buffer. One improvement that I observe, is that if you type the first letter of some previous command, alt-p will bring the immediate previous command, but will not bring the previous command that starts with the same letter. On 11-01-01 03:54 PM, Daniel wrote: > Please ignore my proposal about editing the emacsinit.m. This is > nonsense, sorry. > >> emascsinit('emacs') > > Is equivalent to setting the Editor/Debugger in your matlab > Preferences. You can place this in your startup.m file, but it won't > help since it will always open a new process. > > I think the best way is to install an emacs version that comes with > emacsclient (are you sure that your emacs on ubuntu has no > emacsclient?). > > There is also an other advantage to use emacsclient. for e.g. in your .bashrc >> alias "edit=emacsclient -n -a emacs" > With this you can type 'edit somefile.txt' in a console and it will > open the file in your existing emacs process, if there is one, > otherwise it will start one. > Don't forget to add (server-start) in your emacs config file. > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss -- Sincerely yours, Guangran Kevin Zhu (PhD Candidate) Computational Electromagnetics Lab McGill University Montreal, Canada Tel: 1-514-398-1533 |
From: Dineva, E. E <eve...@ui...> - 2011-01-01 21:54:42
|
Hi Kevin, your mail remind's me that I forgot to mention that one also needs to add for Ubuntu to .bashrc: export EDITOR="emacsclient" and, as Daniel mentioned earlier, one also needs to add to .emacs the line: (server-start) As for searching in the matlab-shell, you can type the initial letters of a command and then browse the history with the up/down arrow keys. Cheers, Evelina On Jan 1, 2011, at 4:38 PM, Guangran Kevin Zhu wrote: > Thank you for the pointer. > > Using emacsclient does not support the debugging and code evaluation, > which I have relied on heavily. > > changing ~/X11/app-defaults/Matlab > > *externalEditorCommand: $EDITOR $FILE & > > does not provide the debugging and evaluation support as well. Thus, > using emacs-shell, to the best of my knowledge, is my only option. I > followed the documentation > > http://blogs.mathworks.com/desktop/2009/09/14/matlab-emacs-integration-is-back/ > > Currently, I am missing on the configuration of linking the matlab > invoked in the buffer back to the current emacs session. > > In the meantime, I experimented with the matlab-shell. In comparison > with invoking the following on a command line, > > $ matlab -nodesktop -nosplash > > I found matlab-shell is nice to use, as I could edit the command in the > buffer. One improvement that I observe, is that if you type the first > letter of some previous command, alt-p will bring the immediate previous > command, but will not bring the previous command that starts with the > same letter. > > > On 11-01-01 03:54 PM, Daniel wrote: >> Please ignore my proposal about editing the emacsinit.m. This is >> nonsense, sorry. >> >>> emascsinit('emacs') >> >> Is equivalent to setting the Editor/Debugger in your matlab >> Preferences. You can place this in your startup.m file, but it won't >> help since it will always open a new process. >> >> I think the best way is to install an emacs version that comes with >> emacsclient (are you sure that your emacs on ubuntu has no >> emacsclient?). >> >> There is also an other advantage to use emacsclient. for e.g. in your .bashrc >>> alias "edit=emacsclient -n -a emacs" >> With this you can type 'edit somefile.txt' in a console and it will >> open the file in your existing emacs process, if there is one, >> otherwise it will start one. >> Don't forget to add (server-start) in your emacs config file. >> >> ------------------------------------------------------------------------------ >> Learn how Oracle Real Application Clusters (RAC) One Node allows customers >> to consolidate database storage, standardize their database environment, and, >> should the need arise, upgrade to a full multi-node Oracle RAC database >> without downtime or disruption >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > > > -- > Sincerely yours, > > Guangran Kevin Zhu (PhD Candidate) > Computational Electromagnetics Lab > McGill University > Montreal, Canada > Tel: 1-514-398-1533 > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |
From: Daniel <sn...@gm...> - 2011-01-02 00:04:24
|
> Using emacsclient does not support the debugging and code evaluation, > which I have relied on heavily. There should be no difference. Since everything emacsclient does is to check if there is an emacs process running and open the file in this existing process. > Currently, I am missing on the configuration of linking the matlab > invoked in the buffer back to the current emacs session. I think your configuration should be fine if you add (server-start) to your emacs config file and use emacsinit('emacsclient -n'). This will provide the link back to emacs. |
From: Guangran Z. <gua...@ma...> - 2011-01-05 03:10:23
|
Thank you guys. Another play of two hours solved the problem. The matlab-shell talks back to the current buffer now. On 11-01-01 07:04 PM, Daniel wrote: >> Using emacsclient does not support the debugging and code evaluation, >> which I have relied on heavily. > > There should be no difference. Since everything emacsclient does is to > check if there is an emacs process running and open the file in this > existing process. > >> Currently, I am missing on the configuration of linking the matlab >> invoked in the buffer back to the current emacs session. > > I think your configuration should be fine if you add (server-start) to > your emacs config file and use emacsinit('emacsclient -n'). This will > provide the link back to emacs. > > ------------------------------------------------------------------------------ > Learn how Oracle Real Application Clusters (RAC) One Node allows customers > to consolidate database storage, standardize their database environment, and, > should the need arise, upgrade to a full multi-node Oracle RAC database > without downtime or disruption > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss -- Sincerely yours, Kevin Guangran Zhu (PhD Candidate) Computational Electromagnetics Lab McGill University Montreal, Canada Tel: 1-514-398-1533 |