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 15:26:15 -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]:34687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbZtd-0006cI-CN for emacs-orgmode@gnu.org; Fri, 27 Mar 2015 15:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbZta-00066p-5q for emacs-orgmode@gnu.org; Fri, 27 Mar 2015 15:26:21 -0400 Received: from smtp.andrew.cmu.edu ([128.2.105.202]:38079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbZta-00066j-1j for emacs-orgmode@gnu.org; Fri, 27 Mar 2015 15:26:18 -0400 In-reply-to: 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: "Charles C. Berry" Cc: Daimrod , emacs-orgmode@gnu.org that makes sense. Charles C. Berry writes: > On Fri, 27 Mar 2015, John Kitchin wrote: > >> 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. >> > > The quoted part of the manual does suggest that lisp snippets should work > like `:post (do-something *this*)' > > But perhaps *this* (pun intended) is what was meant: an emacs-lisp block > can refer to `*this*' without needing to pass the value as a header > argument. > > > #+NAME: abc > #+BEGIN_SRC emacs-lisp > (concat *this* " and that") > #+END_SRC > > > #+BEGIN_SRC emacs-lisp :post abc() > "T-H-I-S" > #+END_SRC > > #+RESULTS: > : T-H-I-S and that > > > > [snip] > >>> 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= results 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 va= riable. 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. >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > Chuck -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu