emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] #+header: :post -> Symbol's value as variable is void: *this*


From: Aaron Ecay
Subject: Re: [O] #+header: :post -> Symbol's value as variable is void: *this*
Date: Wed, 06 Aug 2014 00:12:01 -0400
User-agent: Notmuch/0.18.1+51~gbbbdf04 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-unknown-linux-gnu)

Hi Thorsten,

2014ko uztailak 27an, Thorsten Jolitz-ek idatzi zuen:
> 
> Thorsten Jolitz <address@hidden> writes:
> 
>> Hi List, 
>> 
>> whats wrong with this :post header arg:
>> 
>> #+header: :post (format "#+attr_latex :float :placement {c}{scale=.6}\n%s" 
>> *this*) 
>> #+begin_src emacs-lisp 
>> (+ 2 2)
>> #+end_src
>> 
>> When I understand 
>> 
>> ,----
>> | http://orgmode.org/manual/post.html
>> `----
>> 
>> correctly, *this* should hold the block results, but I get 
>> 
>> ,----
>> | Symbol's value as variable is void: *this*
>> `----
> 
> 
> This works:
> 
> #+name: myconcat
> #+header: :var x=""
> #+begin_src emacs-lisp
>  (format "Do %sx then quit" x)
> #+end_src
> 
> 
> #+header: :post myconcat(x=*this*)
> #+begin_src emacs-lisp 
>  (+ 2 2)
> #+end_src
> 
> #+results:
> : Do 4x then quit
> 
> 
> but how do I interpret the following sentence from the manual:
> 
> ,----
> | This variable [*this*] may then be included in header argument forms
> | such as those used in var header argument specifications allowing
> | passing of results to other code blocks, or direct execution via Emacs
> | Lisp.
> `----
> 
> What is meant by 'direct execution via Emacs Lisp' here? I think the
> above construct with two src-blocks is a bit heavy for the rather small
> task and hoped I could just give an Emacs Lisp expression containing
> *this* as value to the :post header arg, but apparently not?
> 
> #+header: :post (format "Do %sx then quit" *this*)
> #+begin_src emacs-lisp 
>  (+ 2 2)
> #+end_src
> 
> -> eval: Symbol's value as variable is void: *this*

The value of :post should be a babel call (in the same format as e.g. a
#+call line), not an elisp form.  If babel sees something that looks
like elisp, it will attempt to ‘eval’ it when parsing the src block,
before *this* is bound (which happens only upon execution, after
parsing).

-- 
Aaron Ecay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]