From: Laurent J. <lau...@uc...> - 2011-07-26 13:14:01
|
This works great! Thanks Eric. Under Mac OS, once a terminal is open through emacs or not (say in /dev/ttys001) I can do now, inside a matlab script, fid=fopen('/dev/ttys001','w'); fprintf(fid,'hello world\n'); and this message is truly printed in this terminal! This is nothing but the stdout redirection I was looking for. Best, Laurent On 26/07/11 14:54, Eric Ludlam wrote: > I used to do this back in 1996 or so, and it worked like this: > > Use: > M-x shell RET > > to create a shell, or create a shell with a name by using C-u prefix to the shell command. > > In the shell, you can find out which terminal it used. Sometimes it is an environment variable. I found I can use the 'tty' command on my linux box today. > > You can fopen that file name and write to it as long as permissions are set ok. > > I tried this in my emacs today with > > echo "moose">> /dev/pts/4 > > and that worked to get to my other shell window. > > Good Luck > Eric > > -----Original Message----- > From: Laurent Jacques [mailto:lau...@uc...] > Sent: Tuesday, July 26, 2011 6:41 AM > To: mat...@li... > Subject: [Matlab-emacs-discuss] fprintf/disp output to another emacs buffer ? > > Dear all, > > Question: Do you know if it is possible to redirect the output of a matlab disp()/fprintf() (possibly using another command) to another emacs buffer than the one running matlab-shell ? > > Objective: When running a "cell" inside a matlab script, this possibility would allow me to display some computation messages or results without to be disturbed by the script code that is always recopied in the matlab shell with the fprintf/disp output. > > > Best regards, > Laurent > > > > > -- > Dr. Laurent JACQUES > Postdoctoral Researcher, Return Grant, BELSPO, Belgium > > Institute of Information and Communication Technologies, > Electronics and Applied Mathematics (ICTEAM-TELE) University of Louvain Batiment Stévin Place du Levant 2, PO Box L5.04.04 > 1348 Louvain-la-Neuve, Belgium > > Office: a.133 > Tel: +32 10 47 81 24 > Fax: +32 10 47 20 89 > http://perso.uclouvain.be/laurent.jacques > > > ------------------------------------------------------------------------------ > Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. > http://www.accelacomm.com/jaw/sfnl/114/51385063/ > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss -- Dr. Laurent JACQUES Postdoctoral Researcher, Return Grant, BELSPO, Belgium Institute of Information and Communication Technologies, Electronics and Applied Mathematics (ICTEAM-TELE) University of Louvain Batiment Stévin Place du Levant 2, PO Box L5.04.04 1348 Louvain-la-Neuve, Belgium Office: a.133 Tel: +32 10 47 81 24 Fax: +32 10 47 20 89 http://perso.uclouvain.be/laurent.jacques |