emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: Sebastien Vauban
	<public-sva-news-D0wtAvR13HarG/iDocfnWg@plane.gmane.org>
Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org
Subject: Re: [BUG] on export resulting in endless evaluation
Date: Mon, 09 Feb 2015 13:25:40 +0100	[thread overview]
Message-ID: <m2r3tz46gr.fsf@krugs.de> (raw)
In-Reply-To: <86twyvbb86.fsf@example.com> (Sebastien Vauban's message of "Mon, 09 Feb 2015 12:00:57 +0100")

[-- Attachment #1: Type: text/plain, Size: 3975 bytes --]

Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:

> Rainer M Krug wrote:
>> Charles Berry <ccberry-XkckGZ689+c@public.gmane.org> writes:
>>> Rainer M Krug <Rainer <at> krugs.de> writes:
>>>> 
>>>> when exporting the fillowing org file, I get an endless loop of
>>>> evaluations.
>>>> 
>>>> --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 
>>>> cat(13+14)
>>>> #+end_src
>>>> 
>>>> * and here only code
>>>> :PROPERTIES:
>>>> :header-args+: exports code
>>>> :END:
>>>> #+begin_src R 
>>>> 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

--8<---------------cut here---------------start------------->8---
(when header-args     (funcall printf "header-args: %s\n"     header-args))
--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 added 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 =:headerArgument string=
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:


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

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

  reply	other threads:[~2015-02-09 12:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 10:06 [BUG] on export resulting in endless evaluation Rainer M Krug
2015-02-06 17:50 ` Charles Berry
2015-02-07 14:46   ` Rainer M Krug
2015-02-09 11:00     ` Sebastien Vauban
2015-02-09 12:25       ` Rainer M Krug [this message]
2015-02-10  0:44         ` Charles Berry
2015-02-10  8:25           ` Rainer M Krug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r3tz46gr.fsf@krugs.de \
    --to=rainer@krugs.de \
    --cc=public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org \
    --cc=public-sva-news-D0wtAvR13HarG/iDocfnWg@plane.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).