Ah,  sorry I can't be more help.  It has been many years since I worked on that 
code, and I don't use Emacs much anymore.  There are accommodations in the 
function's I referenced for the ML command line to make sure it doesn't 
interrupting anything a user might be typing in that would be important for 
your use case.

It might be worth trying the Matlab help stuff in matlab-mode/matlab-shell to 
see if it still works.  This is code that will call help, and put output into a 
separate buffer.  I haven't tested it in ages, so if it isn't working in ML 
shell, that might explain any issues you're bumping into with org mode.

Eric

-----Original Message-----
From: Uwe Brauer [mailto:o...@mat.ucm.es] 
Sent: Friday, November 03, 2017 10:39 AM
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:

   > 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.


Yeah I tried to debug it and to understand its structure. The 
matlab-shell-command is, at least for me, maybe the most complex part of the 
code. On the other hand the crucial parts of John's code are the lines

      (let ((results (shell-command-to-string
                    (concat
                     "/usr/local/bin/matlab "
                     "-nodesktop -nojvm -nosplash -nodisplay <"
                     m-file))))

So I hoped somebody with a better understanding of the matlab-shell-command 
could give me a hint, but it seems that the merge between John's code and 
matlab-shell is much more complicated.


   > 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.

Yes I did and John's code does precisely this. I asked the same question on the 
orgmode list and John replied. The only problem with his code is that it uses 
the command line matlab command and so starts every time matlab, when the code 
is executed.


   > 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.

No that is ok, I hoped orgmode could take that part as well but all my attempts 
failed.

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

Reply via email to