From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Can I wrap a Babel call inside a macro? Date: Fri, 24 Jan 2014 09:29:05 +0100 Message-ID: <87wqhpvl4e.fsf@gmail.com> References: <86ppniuxp0.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6c8U-00073p-Gg for emacs-orgmode@gnu.org; Fri, 24 Jan 2014 03:29:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6c8M-0006WC-AW for emacs-orgmode@gnu.org; Fri, 24 Jan 2014 03:29:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:36781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6c8M-0006W7-3F for emacs-orgmode@gnu.org; Fri, 24 Jan 2014 03:29:02 -0500 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W6c8J-0005oc-5P for emacs-orgmode@gnu.org; Fri, 24 Jan 2014 09:28:59 +0100 In-Reply-To: <86ppniuxp0.fsf@somewhere.org> (Sebastien Vauban's message of "Thu, 23 Jan 2014 23:42:51 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org Hello, "Sebastien Vauban" 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: > >
>

1 Tests

> >
>
>
> echo  "color: #036A07;">"$(date '+%Y%m%d.%H%M')"
> 
>
> >

Date/time:

>
> 20140123.2338
> 
> >

The current date and time is: #+CALL: current-time().

>
^^^^^^^^^^^^^^^^^^^^^^ >
> > 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