Sorry for not being more precise. Inside 'matlab-shell-save-and-go' is infrastructure for building something custom for org-mode. For example, how it looks for a shell buffer and creates on only if needed, and how it updates the history (which you could remove) and how it executes the string. It is similar to run-region in how it works w/ the shell buffer.
In a different part of the thread, you wanted to capture the output to insert into org-mode. 'matlab-shell-run-command' will capture the output to display in a help buffer. You could probably use its mechanisms to capture the output from the shell to display where you need it. If you want to capture images from any figures created, there is nothing for that. You'd need to add something the matlab-emacs toolbox for capturing and saving images in a way that Emacs could then pick up the files. Eric -----Original Message----- From: Uwe Brauer [mailto:o...@mat.ucm.es] Sent: Tuesday, October 31, 2017 5:27 PM To: Eric Ludlam <eric.lud...@mathworks.com> Cc: Uwe Brauer <o...@mat.ucm.es>; matlab-emacs-discuss <matlab-emacs-discuss@lists.sourceforge.net> Subject: Re: [Matlab-emacs-discuss] executing matlab in org mode files (using the matlab-shell) >>> "Eric" == Eric Ludlam <eric.lud...@mathworks.com> writes: > MATLAB mode has a command to execute region in the MATLAB Shell from a > .M file. I see no reason why you couldn't re-use that. > It may be it needs updating to also start the shell, or to chdir if > there is a function, or something like that. Hm suppose the shell is running. The core of his function are the following lines (let ((results (shell-command-to-string (concat "/usr/local/bin/matlab " "-nodesktop -nojvm -nosplash -nodisplay <" m-file)))) So are you saying I should try (switch-to-buffer m-file) (find-file m-file) ;? None worked (let ((results (matlab-shell-save-and-go) (delete-file m-file) rest of code))) Hm this did not work, so most likely I am not taking care of something elementary here. Uwe ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Matlab-emacs-discuss mailing list Matlab-emacs-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss