From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: #+header: :post -> Symbol's value as variable is void: *this* Date: Wed, 06 Aug 2014 10:54:57 +0200 Message-ID: <871tsu80bi.fsf@gmail.com> References: <87a97vhor9.fsf@gmail.com> <87lhrftg5s.fsf@gmail.com> <87egwuw92m.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEx0G-0005Bd-8V for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 04:55:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEx0A-0004XS-3J for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 04:55:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:37969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEx09-0004XF-SW for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 04:55:18 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XEx03-0008IM-6z for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 10:55:11 +0200 Received: from g231111166.adsl.alicedsl.de ([92.231.111.166]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Aug 2014 10:55:11 +0200 Received: from tjolitz by g231111166.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Aug 2014 10:55:11 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Aaron Ecay writes: Hi Aaron, > 2014ko uztailak 27an, Thorsten Jolitz-ek idatzi zuen: >> >> Thorsten Jolitz 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). Thats #+CALL: () then, and looks like the headerline of the working example above: #+header: :post myconcat(x=*this*) Then there is no way to achieve what I had in mind. Thx. -- cheers, Thorsten