From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: #+header: :post -> Symbol's value as variable is void: *this* Date: Wed, 06 Aug 2014 00:12:01 -0400 Message-ID: <87egwuw92m.fsf@gmail.com> References: <87a97vhor9.fsf@gmail.com> <87lhrftg5s.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEsaB-0007wB-2Q for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 00:12:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEsa5-0005vX-8a for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 00:12:11 -0400 Received: from mail-qa0-x234.google.com ([2607:f8b0:400d:c00::234]:56937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEsa5-0005vT-4V for emacs-orgmode@gnu.org; Wed, 06 Aug 2014 00:12:05 -0400 Received: by mail-qa0-f52.google.com with SMTP id j15so1967658qaq.11 for ; Tue, 05 Aug 2014 21:12:04 -0700 (PDT) In-Reply-To: <87lhrftg5s.fsf@gmail.com> 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: Thorsten Jolitz , emacs-orgmode@gnu.org Hi Thorsten, 2014ko uztailak 27an, Thorsten Jolitz-ek idatzi zuen: >=20 > Thorsten Jolitz writes: >=20 >> Hi List,=20 >>=20 >> whats wrong with this :post header arg: >>=20 >> #+header: :post (format "#+attr_latex :float :placement {c}{scale=3D.6}\= n%s" *this*)=20 >> #+begin_src emacs-lisp=20 >> (+ 2 2) >> #+end_src >>=20 >> When I understand=20 >>=20 >> ,---- >> | http://orgmode.org/manual/post.html >> `---- >>=20 >> correctly, *this* should hold the block results, but I get=20 >>=20 >> ,---- >> | Symbol's value as variable is void: *this* >> `---- >=20 >=20 > This works: >=20 > #+name: myconcat > #+header: :var x=3D"" > #+begin_src emacs-lisp > (format "Do %sx then quit" x) > #+end_src >=20 >=20 > #+header: :post myconcat(x=3D*this*) > #+begin_src emacs-lisp=20 > (+ 2 2) > #+end_src >=20 > #+results: > : Do 4x then quit >=20 >=20 > but how do I interpret the following sentence from the manual: >=20 > ,---- > | 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. > `---- >=20 > 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? >=20 > #+header: :post (format "Do %sx then quit" *this*) > #+begin_src emacs-lisp=20 > (+ 2 2) > #+end_src >=20 > -> 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 =E2=80=98eval=E2=80=99 it when parsing the s= rc block, before *this* is bound (which happens only upon execution, after parsing). --=20 Aaron Ecay