emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Rodrigo Morales <moralesrodrigo1100@gmail.com>,
	org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: [feature request] The :pre header argument
Date: Mon, 05 Apr 2021 12:49:09 +0800	[thread overview]
Message-ID: <875z112v5m.fsf@localhost> (raw)
In-Reply-To: <CAGxMbPYWCc57Cb6O+JbCJGZZzSZyw81WwvgFz6H_aU0YRKp3CQ@mail.gmail.com>

Hi,

Rodrigo Morales <moralesrodrigo1100@gmail.com> writes:

> I've provided more relevant information on this feature request [[
> https://codeberg.org/rdrg109/gists/src/branch/main/feature-request-pre-header-argument.org][here]].
> Please consider reading that instead of the first message on this thread.

I think the origin intention of the :post header argument is slightly
different from your use-case. It is intended to be used for
post-processing the results:

> The ‘post’ header argument is for post-processing results from block
> evaluation.  When ‘post’ has any value, Org binds the results to
> ‘*this*’ variable for easy passing to ‘var’ header argument
> specifications (see *note Environment of a Code Block::).  That makes
> results available to other code blocks, or even for direct Emacs Lisp
> code execution.

If you want to execute some arbitrary code before/after your code block,
it is probably more canonical to use noweb references. Using your
example:

#+begin_src emacs-lisp
# Cleanup first using experiments/clean-dir(): "<<experiments/clean-dir()>>"
# Create dir structure using
# minimal-reproducible-example/create-dir-structure:
# "<<minimal-reproducible-example/create-dir-structure()>>"
# Finally, execute `tree' using experiments/execute-tree:
(message "<<experiments/execute-tree()>>")
#+end_src

It will not produce spurious variable definitions.

Best,
Ihor





      reply	other threads:[~2021-04-05  4:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 21:48 [feature request] The :pre header argument Rodrigo Morales
2021-02-19 13:33 ` Rodrigo Morales
2021-02-20  1:50   ` Rodrigo Morales
2021-04-05  4:49     ` Ihor Radchenko [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=875z112v5m.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moralesrodrigo1100@gmail.com \
    /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).