emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Generate BEGIN_EXAMPLE block dynamically during export
Date: Tue, 16 Feb 2016 15:51:06 -0500	[thread overview]
Message-ID: <CAFyQvY3z0JUSBPeK1B3G+r7h9Np1V+SOqce3_uExwYaSJ4SnvA@mail.gmail.com> (raw)
In-Reply-To: <m237ssxw3e.fsf@tsdye.com>

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

Thanks Tom.

Your solution almost gets me there but I still need to manually update the
tar-file argument value in the #+CALL lines.

What I am looking for is for something like below to work (but it isn't). I
have multiple such #+CALL lines and I would like to not manually update the
tar-file arg in all those.
Below does not work because the {{{TAR_FILE}}} macro does not get expanded
in the #+CALL line.

#+MACRO: TAR_FILE some_file.tar.gz

#+NAME: tar-eg
#+HEADER: :var tar-file="" :exports none
#+BEGIN_SRC emacs-lisp
(format "> tar xzvf %s" tar-file)
#+END_SRC

#+CALL: tar-eg(tar-file="{{{TAR_FILE}}}") :wrap example :exports results

[-- Attachment #2: Type: text/html, Size: 1248 bytes --]

  reply	other threads:[~2016-02-16 20:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 19:10 Generate BEGIN_EXAMPLE block dynamically during export Kaushal Modi
2016-02-16 20:02 ` Thomas S. Dye
2016-02-16 20:51   ` Kaushal Modi [this message]
2016-02-16 21:03     ` Thomas S. Dye
2016-02-16 21:16       ` Kaushal Modi
2016-02-16 21:47         ` Kaushal Modi
2016-02-16 22:18           ` Thomas S. Dye
2016-02-16 22:20             ` Kaushal Modi
2016-02-16 22:28           ` Nick Dokos
2016-02-16 22:40             ` Kaushal Modi
2016-02-16 23:10               ` Kaushal Modi

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=CAFyQvY3z0JUSBPeK1B3G+r7h9Np1V+SOqce3_uExwYaSJ4SnvA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.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).