emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] nested macro expansion?


From: Eric Abrahamsen
Subject: Re: [O] nested macro expansion?
Date: Wed, 19 Aug 2015 19:33:15 +0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> What I'm trying to do is have a macro that takes the computed TIMESTAMP
> property for an entry, and then runs it through a custom function that
> breaks out the start/end times, and produces a nicely formatted string
> from that.
>
> I don't see how to write a macro that feeds the value of a computed
> special property to a function.
>
> Right now my testing version looks like this:
>
> #+MACRO: bubba (eval (format-time-string "%Y" "$1"))
>
> and I'm calling it like this:
>
> {{{bubba({{{property(TIMESTAMP)}}})}}}
>
> That doesn't expand the interior "{{{property(TIMESTAMP)}}}" clause.
> What `format-time-string' ends up seeing is "{{{property(TIMESTAMP",
> without the final braces etc.
>
> Is there any way to get that value expanded first, and then passed to
> `format-time-string' (or, eventually, my custom function)?

After googling for a while, I also thought this might work:

#+MACRO: bubba (eval (format-time-string "%Y" property{{{TIMESTAMP}}}))

{{{bubba}}}

But the nested definition isn't expanded, either with or without quotes.

E




reply via email to

[Prev in Thread] Current Thread [Next in Thread]