emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: "Charles C. Berry" <ccberry@ucsd.edu>
Cc: Daimrod <daimrod@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: ':post' Direct execution via Emacs Lisp
Date: Fri, 27 Mar 2015 15:26:15 -0400	[thread overview]
Message-ID: <m2y4mi5jjc.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <alpine.OSX.2.00.1503270855560.603@charles-berrys-macbook.local>

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 ‘: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.
>>>                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
> 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

      reply	other threads:[~2015-03-27 19:26 UTC|newest]

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

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=m2y4mi5jjc.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=ccberry@ucsd.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).