emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] ':post' Direct execution via Emacs Lisp


From: John Kitchin
Subject: Re: [O] ':post' Direct execution via Emacs Lisp
Date: Fri, 27 Mar 2015 09:46:22 -0400

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=""
(concat "====================\n" data "================\n"))
#+END_SRC

#+BEGIN_SRC python :post wrap(*this*)
print 66
#+END_SRC

#+RESULTS:
: ====================
: 66
: ================

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 ‘:post’
>
> The ‘:post’ 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 ‘*this*’ variable.  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



reply via email to

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