emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inconsistent {{{time}}} org macro expansion
@ 2016-01-28 19:59 Kaushal Modi
  2016-01-28 23:54 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Kaushal Modi @ 2016-01-28 19:59 UTC (permalink / raw)
  To: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

Hi,

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?

This is my org version: Org-mode version 8.3.3 (release_8.3.3-509-gc17fcc @
/home/kmodi/usr_local/apps/6/emacs/emacs-25/share/emacs/site-lisp/org/)


Thanks.

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 2060 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inconsistent {{{time}}} org macro expansion
  2016-01-28 19:59 Inconsistent {{{time}}} org macro expansion Kaushal Modi
@ 2016-01-28 23:54 ` Nicolas Goaziou
  2016-01-29 16:46   ` Kaushal Modi
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2016-01-28 23:54 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: emacs-org list

Hello,

Kaushal Modi <kaushal.modi@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Inconsistent {{{time}}} org macro expansion
  2016-01-28 23:54 ` Nicolas Goaziou
@ 2016-01-29 16:46   ` Kaushal Modi
  0 siblings, 0 replies; 3+ messages in thread
From: Kaushal Modi @ 2016-01-29 16:46 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-org list

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Thank you! I verified that the bug is now fixed.

[-- Attachment #2: Type: text/html, Size: 70 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-29 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 19:59 Inconsistent {{{time}}} org macro expansion Kaushal Modi
2016-01-28 23:54 ` Nicolas Goaziou
2016-01-29 16:46   ` Kaushal Modi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).