emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [patch] Formatting of {{{DATE}}}


From: Nicolas Goaziou
Subject: Re: [O] [patch] Formatting of {{{DATE}}}
Date: Mon, 09 Feb 2015 01:05:40 +0100

Correcting myself,

Nicolas Goaziou <address@hidden> writes:

> I suggest
>
>   (cons "date"
>         (format
>          "(eval (if (org-string-nw-p \"$1\") %s %S))"
>          "(org-export-get-date info \"$1\")"
>          (or (org-element-interpret-data (plist-get info :date))
>              "")))

Please scratch that, reference to "info" will prevent us to move to use
lexical binding later. Something like this is required instead:

  (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)))

I think the later part could use an `org-element-copy' function (to be
implemented).



reply via email to

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