emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: "Göktuğ Kayaalp" <self@gkayaalp.com>
Cc: Org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Export datetree item subtree with its date, not the file's
Date: Wed, 21 Oct 2015 01:50:00 -0400	[thread overview]
Message-ID: <87k2qgn52v.fsf@kyleam.com> (raw)
In-Reply-To: <87wpuhsih8.fsf@gkayaalp.com> ("Göktuğ Kayaalp"'s message of "Tue, 20 Oct 2015 17:49:23 +0300")

Göktuğ Kayaalp <self@gkayaalp.com> writes:

> Hello,
>
> Thanks  for your  response.  As  you suggest,  I switched  to using  the
> EXPORT_DATE property.  It works as expected.
>
> Now a little problem  that I have is that I  cannot have timestamps like
> «10 September 2015» in my exports, but a literal inactive timestamp.

> This is because in  the related capture template, I have  to use `%u' to
> add a timestamp, which adds an inactive timestamp, reusing the date that
> I entered into  the datetree prompt.  There is the  %<...> directive for
> the capture  templates which allows  me to put in  a time format,  as in
> `format-time-string',  but it  gets its  value from  `current-time', not
> from the date  of the datetree prompt.  Now  I do not know if  this is a
> feature or  a bug, but if  I want to  copy over lecture notes  from some
> time ago, it's a problem.

Perhaps someone can suggest a better method, but what about adding an
export filter that formats inactive timestamps the way you want?
Something like

    (setq org-latex-inactive-timestamp-format "%s")
    
    (defun u/format-inactive-timestamp (text backend info)
      (when (org-export-derived-backend-p backend 'latex)
        (format-time-string
         "%D" (apply #'encode-time (org-parse-time-string text)))))
    
    (add-to-list 'org-export-filter-timestamp-functions
                 'u/format-inactive-timestamp)

--
Kyle

  reply	other threads:[~2015-10-21  5:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  9:49 Export datetree item subtree with its date, not the file's Göktuğ Kayaalp
2015-10-17  7:33 ` Kyle Meyer
2015-10-20 14:49   ` Göktuğ Kayaalp
2015-10-21  5:50     ` Kyle Meyer [this message]
2015-10-21  8:42     ` Eric S Fraga

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=87k2qgn52v.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=self@gkayaalp.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).