emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: Charles Berry <ccberry@ucsd.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] on export resulting in endless evaluation
Date: Sat, 07 Feb 2015 15:46:56 +0100	[thread overview]
Message-ID: <m2egq193tr.fsf@krugs.de> (raw)
In-Reply-To: <loom.20150206T183225-433@post.gmane.org> (Charles Berry's message of "Fri, 6 Feb 2015 17:50:03 +0000 (UTC)")

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

Charles Berry <ccberry@ucsd.edu> writes:

> 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:
>
>
> #+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: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

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

  reply	other threads:[~2015-02-07 14:47 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 [this message]
2015-02-09 11:00     ` Sebastien Vauban
2015-02-09 12:25       ` Rainer M Krug
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=m2egq193tr.fsf@krugs.de \
    --to=rainer@krugs.de \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.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).