From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BUG] on export resulting in endless evaluation Date: Mon, 09 Feb 2015 13:25:40 +0100 Message-ID: References: <86twyvbb86.fsf@example.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKnPj-0006Ul-1R for emacs-orgmode@gnu.org; Mon, 09 Feb 2015 07:26:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKnPe-0005qQ-1q for emacs-orgmode@gnu.org; Mon, 09 Feb 2015 07:26:06 -0500 Received: from plane.gmane.org ([80.91.229.3]:34333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKnPd-0005pp-OO for emacs-orgmode@gnu.org; Mon, 09 Feb 2015 07:26:02 -0500 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YKnPa-0007ol-N1 for emacs-orgmode@gnu.org; Mon, 09 Feb 2015 13:25:58 +0100 In-Reply-To: <86twyvbb86.fsf@example.com> (Sebastien Vauban's message of "Mon, 09 Feb 2015 12:00: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: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Sebastien Vauban writes: > Rainer M Krug wrote: >> Charles Berry writes: >>> Rainer M Krug krugs.de> writes: >>>>=20 >>>> when exporting the fillowing org file, I get an endless loop of >>>> evaluations. >>>>=20 >>>> --8<---------------cut here---------------start------------->8--- >>>> #+PROPERTY: header-args :exports both >>>> #+PROPERTY: header-args+ :results output >>>> * The bug >>>> This file create an (possibly endless?) loop during export >>>> * here exports both >>>> #+begin_src R=20 >>>> cat(13+14) >>>> #+end_src >>>>=20 >>>> * and here only code >>>> :PROPERTIES: >>>> :header-args+: exports code >>>> :END: >>>> #+begin_src R=20 >>>> paste(13+14) >>>> #+end_src >>>> --8<---------------cut here---------------end--------------->8--- >>> >>> Add this to the end of your example and run the src block: >>> >>> #+BEGIN_SRC emacs-lisp :results pp >>> (org-entry-get (point) "header-args" t) >>> #+END_SRC >>> >>> #+RESULTS: >>> : ":exports both :results output exports code" >> >> Very useful function - I think I will use it quite often! I would have >> seen the problem immediately - the missing : > > FWIW, `C-c C-v I' (or `C-c C-v C-I') would show you: Now this is really helpful. Brilliant. Now If I do this in the faulty block, I get: ,---- | Lang: R | Header Arguments: | :cache no | :exports both | :hlines no | :noweb no | :results code exports output replace | :session none | :tangle no `---- And I can see if something is wrong. One question remains: to debug wrong header arguments, it would be useful to see, in addition to the resulting header arguments, where they came from, especially the header-args argument would be useful to see. So I added the line =2D-8<---------------cut here---------------start------------->8--- (when header-args (funcall printf "header-args: %s\n" header-args)) =2D-8<---------------cut here---------------end--------------->8--- to the output, and was surprised: Using the second code block in my example, I get (line breaks and bold adde= d for readability): ,---- | Lang: R | header-args: ((:comments . ) (:shebang . ) (:cache . no) (:padline . ) | (:noweb . no) (:tangle . no) (:exports . both) (:results . code exports | output replace) (:hlines . no) (:session . none)) | Header Arguments: | :cache no | :exports both | :hlines no | :noweb no | :results code exports output replace | :session none | :tangle no `---- 1) I thought that header-args is simply a string, but it already seems to be a list? 2) Am I right in assuming that when I use header-args, the string passed is parsed and then either set as header-args or, if using header-args+, added to the header-args? 3) even when using +, the previously set value *of the header argument* is = overwritten? 4) if an invalid string is given, where is it appended? Woulddn't it make sense to only accept values of the pattern =3D:headerArgument string=3D to avoid these kind of user errors? 5) Is there any way in getting, in this function, the same output (header-args) as from the code block suggested by Charles: =2D-8<---------------cut here---------------start------------->8--- #+BEGIN_SRC emacs-lisp :results pp (org-entry-get (point) "header-args" t) #+END_SRC #+RESULTS: : ":exports both :results output exports code" =2D-8<---------------cut here---------------end--------------->8--- Thanks, Rainer > > Lang: R > Header Arguments: > :cache no > :exports code > :hlines no > :noweb no > :results replace > :session none > :tangle no > exports code > > Best regards, > Seb =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJU2KdIAAoJENvXNx4PUvmC8FIIANprX6uPqWbVqEKuJmO7RKXC Q7nfkhuf4gIhRjQAhok/lt4F962aiC3DYehrugq0eu+S1b2uBBodmlV2W7iCNOjn w1+ipp74JuFM+RqPZ+aONoAt1Xb3+z/39GmgknctlVt+R2LMGmGwmozseSMjVVNm pq/ZjeSz8wIbHM1jMTqTmdZVGoyh54DzqiSJ7qm+HFANTvTrYH3IX7iMdxkkh9QU fHiEdhXb7nKae3iJYiEwHg1wMA/y23IFFdw5zlWUN4KK3JDfp1z0bUcPhSu+5o4W 8qaBxhXWjpuSOkktt1fDhdK4jGoHXFhBhaomDHvuc0amNSZxTXwjVGphpVmECn4= =hbHr -----END PGP SIGNATURE----- --=-=-=--