From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Inconsistent {{{time}}} org macro expansion Date: Fri, 29 Jan 2016 00:54:58 +0100 Message-ID: <871t91b6p9.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOwN5-0001jD-Sq for emacs-orgmode@gnu.org; Thu, 28 Jan 2016 18:53:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOwN0-0004Ou-Td for emacs-orgmode@gnu.org; Thu, 28 Jan 2016 18:53:03 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:39090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOwN0-0004OP-Mg for emacs-orgmode@gnu.org; Thu, 28 Jan 2016 18:52:58 -0500 In-Reply-To: (Kaushal Modi's message of "Thu, 28 Jan 2016 19:59:10 +0000") 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: Kaushal Modi Cc: emacs-org list Hello, Kaushal Modi writes: > I am getting different outputs from org-export-get-date depending on > whether I export the full org file or just a selected heading. For #+DATE, > I am using a {{{time}}} macro. > > Here's a test org file: > > ===== > > #+DATE: {{{time(%b %e %Y\, %a)}}} > * Heading 1 > Content 1 > * Heading 2 > Content 2 > > ===== > > And here is a test org-html-postamble function to help debug this: > > ===== > > (defun my/org-html-postamble-fn (info) > (let ((date (car (org-export-get-date info)))) > (message "Date: %S" date))) > (setq org-html-postamble #'my/org-html-postamble-fn) > > ===== > > SCENARIO 1: Normal export [GOOD] > In this scenario, I export the full org file to html (C-c C-e h h) without > selecting anything. > This is the output I get in *Messages* > > Date: #("Jan 28 2016, Thu" 0 16 (:parent (#0))) > > I get a date I case use in the postamble output. > > SCENARIO 2: Export only one of the headings. [BAD] > Now select just the "Heading 1" sub-tree and then do C-c C-e h h. > This time, the output is: > > Date: (macro (:key "time" :value "{{{time(%b %e %Y\\, %a)}}}" :args ("%b %e > %Y, %a") :begin 1 :end 26 :post-blank 0 :parent (#0))) > > So it looks like the time macro did not expand. > > Why is that? Is it a bug? It was. It is now fixed. Thank you. Regards, -- Nicolas Goaziou