From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: ':post' Direct execution via Emacs Lisp Date: Fri, 27 Mar 2015 09:46:22 -0400 Message-ID: References: <87y4mihloj.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]:57606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbUan-0004D6-OZ for emacs-orgmode@gnu.org; Fri, 27 Mar 2015 09:46:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbUah-0005ar-Db for emacs-orgmode@gnu.org; Fri, 27 Mar 2015 09:46:33 -0400 Received: from smtp.andrew.cmu.edu ([128.2.157.39]:58975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbUah-0005aY-8s for emacs-orgmode@gnu.org; Fri, 27 Mar 2015 09:46:27 -0400 In-reply-to: <87y4mihloj.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: Daimrod Cc: emacs-orgmode@gnu.org I cannot see anyway to use direct execution of emacs lisp code in this (and nothing I have tried actually works). Any emacs-lisp code seems to get evaluated before running the block and *this* is not defined then. As advertised, this works: #+name: wrap #+BEGIN_SRC emacs-lisp :var data=3D"" (concat "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n" da= ta "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n")) #+END_SRC #+BEGIN_SRC python :post wrap(*this*) print 66 #+END_SRC #+RESULTS: : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D : 66 : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D But I don't see a way in org-babel-ref-resolve to resolve emacs-lisp as a :post argument. Daimrod writes: > Hi, > > We can read in the manual: > 14.8.2.25 =E2=80=98:post=E2=80=99 > > The =E2=80=98:post=E2=80=99 header argument is used to post-process the r= esults of a > code block execution. When a post argument is given, the results of the > code block will temporarily be bound to the =E2=80=98*this*=E2=80=99 vari= able. This > variable may then be included in header argument forms such as those > used in *note var:: header argument specifications allowing passing of > results to other code blocks, or direct execution via Emacs Lisp. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > IIUC, it means that we can post process the data in Emacs Lisp, that is, > by calling an Emacs Lisp function, not another source block. However, > the example only shows how to do it with another source block. > > Is my understanding correct or not? If so, how can I post process the > result with an Emacs Lisp function? > > Cheers, -- tProfessor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu