From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Sebastien Vauban
<public-sva-news-D0wtAvR13HarG/iDocfnWg@plane.gmane.org>
Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org
Subject: Re: Can I wrap a Babel call inside a macro?
Date: Fri, 24 Jan 2014 09:29:05 +0100 [thread overview]
Message-ID: <87wqhpvl4e.fsf@gmail.com> (raw)
In-Reply-To: <86ppniuxp0.fsf@somewhere.org> (Sebastien Vauban's message of "Thu, 23 Jan 2014 23:42:51 +0100")
Hello,
"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
writes:
> I did the following test, not fully successfull:
>
> #+name: current-time
> #+begin_src sh
> echo "$(date '+%Y%m%d.%H%M')"
> #+end_src
>
> #+results: current-time
> : 20140123.2339
>
> Date/time:
> #+CALL: current-time()
>
> #+results:
> : 20140123.2339
>
> #+MACRO: ct #+CALL: current-time()
>
> The current date and time is:
> {{{ct}}}.
>
> as the HTML export gives:
>
> <div id="outline-container-sec-1" class="outline-2">
> <h2 id="sec-1"><span class="section-number-2">1</span> Tests</h2>
>
> <div class="outline-text-2" id="text-1">
> <div class="org-src-container">
> <pre class="src src-sh" id="current-time">
> <span style="color: #006FE0;">echo</span> <span style=
> "color: #036A07;">"$(date '+%Y%m%d.%H%M')"</span>
> </pre>
> </div>
>
> <p>Date/time:</p>
> <pre class="example">
> 20140123.2338
> </pre>
>
> <p>The current date and time is: #+CALL: current-time().</p>
> </div> ^^^^^^^^^^^^^^^^^^^^^^
> </div>
>
> As macros are expanded _before_ Babel calls are executed, I'd think this
> is possible, but I must miss something...
FWIW, I couldn't reproduce your problem in either maint or master
branch.
Regards,
--
Nicolas Goaziou
next prev parent reply other threads:[~2014-01-24 8:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 22:42 Can I wrap a Babel call inside a macro? Sebastien Vauban
2014-01-24 8:29 ` Nicolas Goaziou [this message]
2014-01-24 8:47 ` Nicolas Goaziou
2014-01-24 9:04 ` Sebastien Vauban
2014-01-24 9:14 ` Nicolas Goaziou
2014-01-24 10:51 ` Sebastien Vauban
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wqhpvl4e.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org \
--cc=public-sva-news-D0wtAvR13HarG/iDocfnWg@plane.gmane.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.