emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Inconsistent {{{time}}} org macro expansion
Date: Fri, 29 Jan 2016 00:54:58 +0100	[thread overview]
Message-ID: <871t91b6p9.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAFyQvY2nY2bd9PHw2sYopyfxn3yRxjfkcn1hh5Cxtm3W=Aq3+w@mail.gmail.com> (Kaushal Modi's message of "Thu, 28 Jan 2016 19:59:10 +0000")

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

  reply	other threads:[~2016-01-28 23:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 19:59 Inconsistent {{{time}}} org macro expansion Kaushal Modi
2016-01-28 23:54 ` Nicolas Goaziou [this message]
2016-01-29 16:46   ` Kaushal Modi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871t91b6p9.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).