[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [patch] Formatting of {{{DATE}}}
From: |
Rasmus |
Subject: |
Re: [O] [patch] Formatting of {{{DATE}}} |
Date: |
Mon, 09 Feb 2015 01:55:06 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hi Nicolas,
Thanks for the tips.
Pushed as 8f38f03. I added a org-NEWS entry, but I don't know if it
should be there. Feel free to let me know or remove it yourself if it
shouldn't.
BTW: when figuring out how the heck macros works I came across two other
undocumented macros, namely {{{input-file}}} and
{{{property(PROPERTY-NAME)}}}. I also added those to the manual.
> (cons "date"
> (let* ((date (plist-get info :date))
> (value (or (org-element-interpret-data date) "")))
> (if (and (null (cdr date))
> (eq (org-element-type (car date)) 'timestamp))
> (format "(eval (if (org-string-nw-p \"$1\") %s %S))"
> (format "(org-timestamp-format '%S \"$1\")"
> ;; Remove parent to avoid
> ;; read error.
> `(timestamp
> ,(org-combine-plists
> (nth 1 (car date))
> '(:parent nil))))
> value)
> value)))
Okay, that's cool. I wasn't aware of %S.
> I think the later part could use an `org-element-copy' function (to be
> implemented).
Seems like it. Perhaps next weekend!
—Rasmus
--
Lasciate ogni speranza o voi che entrate: siete nella mani di'machellaio