From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: evaluation issue with ocaml code (due to changes to org-babel-comint-with-output) Date: Wed, 16 Dec 2015 21:29:05 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9IhH-0006dl-FB for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 15:29:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9IhC-0000dQ-EL for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 15:29:15 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:31059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9IhC-0000d4-3s for emacs-orgmode@gnu.org; Wed, 16 Dec 2015 15:29:10 -0500 In-Reply-To: (Alan Schmitt's message of "Mon, 14 Dec 2015 13:04:57 +0100") 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 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello, I finally found the issue (using the plain debugger): the call to org-babel-comint-with-output was set to remove the echo, but the only time there is an echo of the full body is when a single line function has an error, and this echo is useful to show where the error is. Here is a patch that makes sure the echo is kept. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-ocaml.el-Keep-echo-to-display-ocaml-errors.patch Content-Transfer-Encoding: quoted-printable From=2059e6912e6bf769fff2f48b6c2af95bda918d0cd9 Mon Sep 17 00:00:00 2001 From: Alan Schmitt Date: Wed, 16 Dec 2015 21:19:23 +0100 Subject: [PATCH] ob-ocaml.el: Keep echo to display ocaml errors * ob-ocaml.el (org-babel-execute:ocaml): call `org-babel-comint-with-output' with nil `remove-echo' argument. =2D-- lisp/ob-ocaml.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-ocaml.el b/lisp/ob-ocaml.el index 48f8aba..68ac859 100644 =2D-- a/lisp/ob-ocaml.el +++ b/lisp/ob-ocaml.el @@ -66,7 +66,7 @@ (session (org-babel-prep-session:ocaml (cdr (assoc :session params)) params)) (raw (org-babel-comint-with-output =2D (session org-babel-ocaml-eoe-output t full-body) + (session org-babel-ocaml-eoe-output nil full-body) (insert (concat (org-babel-chomp full-body) ";;\n" =2D-=20 2.6.4 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable For the record, the problem I wanted to fix. On 2015-12-14 13:04, Alan Schmitt writes: >> I have found that commit f0bf77e82a3d37ba7548aa40198bc982e9875f1b breaks >> evaluation of ocaml code. With the following init file (the >> `package-initialize' is there for tuareg to be available): >> >> #+begin_src emacs-lisp >> (add-to-list 'load-path "/Users/schmitta/projets/org-mode/lisp") >> >> (require 'org) >> >> (package-initialize) >> >> (org-babel-do-load-languages >> 'org-babel-load-languages >> '((ocaml . t))) >> #+end_src >> >> When I evaluate this block I get this result: >> >> #+BEGIN_SRC ocaml :results code verbatim :exports results >> 1 + "toto";; >> #+END_SRC >> >> #+results: >> #+BEGIN_SRC ocaml >> Characters 4-10: >> 1 + "toto";;;; >> ^^^^^^ >> Error: This expression has type string but an expression was expected of= type >> int >> #+END_SRC >> >> After commit f0bf77e82a3d37ba7548aa40198bc982e9875f1b I get this: >> >> #+results: >> #+BEGIN_SRC ocaml >> ;; >> ^^^^^^ >> Error: This expression has type string but an expression was expected of= type >> int >> #+END_SRC Best, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 (Updated December 13, 2015, Mauna Loa Obs.): 401.3= 1 ppm --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJWccmRAAoJEAQNCjtO0uXHY68H/1wpE1Dm7eqZ727287knOt7S VACFZ8hbb4PclIF7IUb0mr3PAfFDDqi1ItxEdh8h/xhpxD6vqyIEFSg8hTDf/ahx KgoLZymb+HbQt1hOO72+HCBYLnK6e+cKmpYD/ojo56m8XWMIn8PQl9VpvQXaD25G jEVTGVsrXm30YmFxKCsxsnztzUaSr7XNwCx/CsS45z6EiDDFcqkkguKJxY+7m4sJ VeJijMYPUK27s557Ht2kRp8gV+GTzRMrffrwnkYv98Mw+ITaEA5Xi5j6gPXnN4HG ewsj0TuCsWhahQ9SsNAi7n96TKjBILS30uZT6LGKF6Y6sadDan2VObVCsrvlKeM= =zazT -----END PGP SIGNATURE----- --==-=-=--