Charles Berry writes: > Rainer M Krug 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 >> `---- >> >> --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 : > > > > As you see the property API merely adds the `exports code' to the end of the > "header-args"value. > > Babel then ignores the 'exports' I assume because it does not know it - which makes sense. > 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. OK - I think I understand this logic. > > A bug? Not actually a bug I would say now, but mailny a user error (I did forget the :...) > > I guess Babel could do a better job of screening header-args and barf if invalid > args are submitted. This would be really nice. Also, possibly in the message buffer show the header-args when a block is executed would make this kind of error more obvious? > I believe that `org-babel-merge-params' is the place where a check > could be introduced, but AFAICS there is none such. There should be at least a warning, if not an error thrown, if an invalid header argument is passed. > > Of course `:exports code' solves this, but I think you knew that. :-) Now I know... Thanks, Rainer > > HTH, > > Chuck > > > > > -- Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982