[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [BUG] on export resulting in endless evaluation
From: |
Charles Berry |
Subject: |
Re: [O] [BUG] on export resulting in endless evaluation |
Date: |
Fri, 6 Feb 2015 17:50:03 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Rainer M Krug <Rainer <at> krugs.de> writes:
>
>
> Hi
>
> when exporting the fillowing org file, I get an endless loop of
> evaluations.
>
> This happens with only orgmode and languages enabled
>
> ,----
> | GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, Carbon Version 157
> | Org-mode version 8.3beta (release_8.3beta-798-g528b90 <at>
> `----
>
> --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:
--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---
As you see the property API merely adds the `exports code' to the end of the
"header-args"value.
Babel then ignores the 'exports' and you end up with `:results output code'
which creates an executable src block. Since :exports both' is set, that src
block is executed. And so on.
A bug?
I guess Babel could do a better job of screening header-args and barf if
invalid
args are submitted. I believe that `org-babel-merge-params' is the place where
a check could be introduced, but AFAICS there is none such.
Of course `:exports code' solves this, but I think you knew that. :-)
HTH,
Chuck