emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Daimrod <daimrod@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: ':post' Direct execution via Emacs Lisp
Date: Fri, 27 Mar 2015 09:46:22 -0400	[thread overview]
Message-ID: <m27fu27du9.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <87y4mihloj.fsf@gmail.com>

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	other threads:[~2015-03-27 13:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27  8:46 Daimrod
2015-03-27 13:46 ` John Kitchin [this message]
2015-03-27 16:31   ` Charles C. Berry
2015-03-27 19:26     ` John Kitchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27fu27du9.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=daimrod@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).