From: Laurent J. <lau...@uc...> - 2010-04-30 09:52:38
|
On 29/04/10 20:04, Eric Ludlam wrote: > Hi, > What you see is a side-effect of the fact that MATLAB is parsing that string and displaying all those prompts. I suppose it would be possible to replace all the CRs with , or something, such as the patch I attach, but this won't work if you have ..., or other things that mess with line continuations. > Thanks for your fast answer. It's a beginning of solution. Appending all the commands with commas is not really equivalent to fully hiding the commands but it helps to decouple the commands printing from their outputs. Perhaps something equivalent but slightly more robust would be to embed the cell into a kind of multiple lines eval(). For instance, if the cell is <code> %% Cell 1 cmd1; cmd2; cmd3; %% Cell 2 ... </code> the Matlab shell (through the lisp file matlab.el) would have to launch eval(sprintf(cellstr)) where cellstr is the full string containing the text "%% Cell 1 cmd1; cmd2; cmd3;" i.e., cellstr = '%% Cell 1\n cmd1;\n cmd2;\n cmd3;\n' with perhaps some care for doubling the apostrophes inside. Another point I was wondering, perhaps easier to implement, is how to program the "Run Cell and Advance" of Matlab, i.e. running the current cell and make the pointer jump to the beginning of next cell in the editing of the script file. I regret that I'm not sufficiently specialized in lisp to program myself these two features. My emails could be interpreted simply as a wish list for your mode. If it is too hard to implement, no problem. This mode is already very handy as it. Best regards, Laurent > Perhaps someone else on the list has a clever idea for turning off MATLAB echoing values. > > Eric > > -----Original Message----- > From: Laurent Jacques [mailto:lau...@uc...] > Sent: Thursday, April 29, 2010 11:34 AM > To: mat...@li... > Subject: [Matlab-emacs-discuss] "Run Cell/Region" in quiet mode > > Dear all, > > I have just discovered your matlab emacs mode. > Very nice work!, specially the "cell mode" which was missing from the > previous matlab modes for emacs. > > About this mode, how can I modify the configuration so that the "Run > Cell/Region" is done in a quiet mode (as in Matlab)? > I mean, currently, if in a given matlab script I have > > <code> > %% Cell 1 > > cmd1; > cmd2; > cmd3; > > %% Cell 2 > ... > </code> > > when I run Cell 1 by launching "Run Cell" inside it, the "Matlab Shell" > display > > >> cmd1; > <output cmd1> > >> cmd2; > <output cmd2> > >> cmd3; > <output cmd3> > > However, I'd like to restrict the Matlab Shell display to the only > outputs of the Cell 1, i.e. > > >> > <output cmd1> > <output cmd2> > <output cmd3> > > > Do you think it is possible? > Displaying the cmds induces sometimes a mess in the output of a cell. > > Thanks a lot for your help, > > L. Jacques > > > -- Dr. Laurent JACQUES Postdoctoral Researcher, FRS-FNRS, Belgium Communications and Remote Sensing Laboratory University of Louvain Batiment Stévin Place du Levant, 2 1348 Louvain-la-Neuve, Belgium Office: a.131 Tel: +32 10 47 23 16 Fax: +32 10 47 20 89 http://www.tele.ucl.ac.be/~jacques |