From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Regier Subject: Re: Babel #+CALL: results? Date: Tue, 12 Nov 2013 17:40:29 -0600 (CST) Message-ID: <1530628085.9020.1384299629753.JavaMail.root@ittc.ku.edu> References: <1546434227.8905.1384296864359.JavaMail.root@ittc.ku.edu> <8738n1b4dd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgNZW-000567-Qo for emacs-orgmode@gnu.org; Tue, 12 Nov 2013 18:40:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgNZQ-0006BL-G5 for emacs-orgmode@gnu.org; Tue, 12 Nov 2013 18:40:38 -0500 Received: from stephens.ittc.ku.edu ([129.237.125.220]:53225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgNZQ-0006B3-0V for emacs-orgmode@gnu.org; Tue, 12 Nov 2013 18:40:32 -0500 In-Reply-To: <8738n1b4dd.fsf@gmail.com> 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: Aaron Ecay Cc: emacs-orgmode@gnu.org Oops; forgot to reply-all. Aaron's advice did set me straight, and #+CALL:= is working fine for me now without my ill-advised debugging artifacts. Th= anks to Aaron for the assistance, and to the Org list/maintainers for all t= he great Org tools and documentation. Phil ----- Original Message ----- From: "Aaron Ecay" To: "Phil Regier" , emacs-orgmode@gnu.org Sent: Tuesday, November 12, 2013 5:13:34 PM Subject: Re: [O] Babel #+CALL: results? Hi Phil, I=E2=80=99m far from an expert myself, but I think I see what is going on w= ith your testcases. 2013ko azaroak 12an, Phil Regier-ek idatzi zuen: [...] > *Once* I got output, but I could not reproduce this after making and > undoing a few formatting changes; I would chalk this up to my own > cluelessness, except that I can get what I *think* is statefully > incorrect output from the first block: >=20 > Iteration 1 (control case): Begin with only the #+NAME: ... #+END_SRC wi= th ":results verbatim" and execute block to get >=20 > #+NAME: testfun > #+BEGIN_SRC sh :var Var1=3D"Val1" :results output verbatim > echo "Var1: $Var1" > #+END_SRC >=20 > #+RESULTS: testfun > : Var1: Val1 So far, as expected. > = =20 >=20 > Iteration 2: Replace ":results output verbatim" with ":results output ra= w" and execute block to get >=20 > #+NAME: testfun > #+BEGIN_SRC sh :var Var1=3D"Val1" :results output raw > echo "Var1: $Var1" > #+END_SRC >=20 > #+RESULTS: testfun > Var1: Val1 Also as expected. >=20 >=20 > Iteration 3: Change back to ":results output verbatim" and execute block= to get >=20 > #+NAME: testfun > #+BEGIN_SRC sh :var Var1=3D"Val1" :results output verbatim > echo "Var1: $Var1" > #+END_SRC >=20 > #+RESULTS: testfun > =3DVar1: Val1 > =3DVar1: Val1 Now org would like to remove the previous output. However, it cannot do so, since it does not know where it begins and ends (since raw output could contain in principle anything, or nothign at all). It=E2=80=99s best= to use =E2=80=9Cdrawer=E2=80=9D instead of =E2=80=9Craw=E2=80=9D in most cases= , because the drawer wrapper bounds the result and lets subsequent calls see it and remove it. Without removing the previous result, org tries to add the =E2=80=9CVar1: V= al1=E2=80=9D as verbatim text (before the instance of that text which is left over from the previous call). It looks like even though there is a newline in the string org chooses to use the single-line =3Dverbatim=3D syntax, rather than the multiline : verbatim I don=E2=80=99t know why it does this, and it may be a bug. As for your original example: > #+CALL: testfun[:results output](Var1=3D"Val3") :results output verbatim You don=E2=80=99t need the second :results output. That applies to an invi= sible elisp source block which wraps the evaluation of the #+call line, and which produces no output. I get the right result consistently with #+CALL: testfun(Var1=3D"Val3") #+RESULTS: : Var1: Val3 Or (note the addition of quotes in the result): #+CALL: testfun(Var1=3D"Val3") :results verbatim #+RESULTS: : "Var1: Val3" --=20 Aaron Ecay