From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mikhail Titov" Subject: Re: [babel, patch] ob-octave does not catch EOE from matlabShell on MS Windows Date: Fri, 25 May 2012 11:52:47 -0500 Message-ID: <010801cd3a96$d0ac2360$72046a20$@us> References: <00f901cd39f0$7da5bb00$78f13100$@us> <00ff01cd39f4$7feec3d0$7fcc4b70$@us> <010501cd3a93$ccb65f80$66231e80$@us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0109_01CD3A6C.E7D61B60" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXxko-0003kN-1S for emacs-orgmode@gnu.org; Fri, 25 May 2012 12:52:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXxkm-00053P-DT for emacs-orgmode@gnu.org; Fri, 25 May 2012 12:52:41 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:48356) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SXxkm-00052r-6k for emacs-orgmode@gnu.org; Fri, 25 May 2012 12:52:40 -0400 In-Reply-To: <010501cd3a93$ccb65f80$66231e80$@us> Content-Language: en-us List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. ------=_NextPart_000_0109_01CD3A6C.E7D61B60 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: emacs-orgmode-bounces+mlt=3Dgmx.us@gnu.org = [mailto:emacs-orgmode- > bounces+mlt=3Dgmx.us@gnu.org] On Behalf Of Mikhail Titov > Sent: Friday, May 25, 2012 11:31 AM > To: emacs-orgmode@gnu.org > Subject: Re: [O] [babel] ob-octave does not catch EOE from matlabShell = on MS > Windows >=20 > > > ... > > > > > > I have a simple test block like > > > > > > #+begin_src matlab :session *MATLAB* > > > a=3D2 > > > #+end_src > > > > > > When I try to execute it with C-c C-c , emacs never returns unless = I hit > C- > > g. > > > If I do M-x toggle-debug-on-quit RET I see that for some reason it = keeps > > > waiting for EOE. >=20 > It looks like org-babel-octave-eoe-output and = org-babel-octave-eoe-indicator > were swapped around in org-babel-octave-evaluate-session . >=20 > I have the following in dot emacs >=20 > (setq org-babel-octave-eoe-output " > ans =3D >=20 > org_babel_eoe >=20 > ") For the sake of completeness I'm attaching the patch. Also one should = override (setq org-babel-matlab-emacs-link-wrapper-method "%s if ischar(ans), fid =3D fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); = fclose(fid); else, save -ascii %s ans ; end delete('%s') ") as matlabShell does not like commands split across multiple lines. M. ------=_NextPart_000_0109_01CD3A6C.E7D61B60 Content-Type: application/octet-stream; name="ob-octave_matlab.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ob-octave_matlab.patch" diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el=0A= index 9e85757..8bc48bc 100644=0A= --- a/lisp/ob-octave.el=0A= +++ b/lisp/ob-octave.el=0A= @@ -231,8 +231,8 @@ value of the last statement in BODY, as elisp."=0A= (org-babel-comint-with-output=0A= (session=0A= (if matlabp=0A= - org-babel-octave-eoe-indicator=0A= - org-babel-octave-eoe-output)=0A= + org-babel-octave-eoe-output=0A= + org-babel-octave-eoe-indicator)=0A= t full-body)=0A= (insert full-body) (comint-send-input nil t)))) results)=0A= (case result-type=0A= ------=_NextPart_000_0109_01CD3A6C.E7D61B60--