emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: File modification date
Date: Thu, 20 Aug 2009 21:04:39 +0100	[thread overview]
Message-ID: <6B3BF818-A26F-47A9-9874-D763894513D1@gmail.com> (raw)
In-Reply-To: <87r5v6kfvt.fsf@mundaneum.com>


On Aug 20, 2009, at 10:12 AM, Sébastien Vauban wrote:

> Hi,
>
> I've always found the DATE header to be kind of useless, as it only  
> indicates
> the creation date of the file.
>
> For me, it would be better if it would be the last edit date as it  
> is the case
> with the Emacs time-stamp.
>
> Here a proposition to make this automagic:
>
> --8<---------------cut here---------------start------------->8---
> (add-hook 'org-mode-hook
>          (lambda ()
>            (set (make-local-variable 'time-stamp-format) "%:y-%02m- 
> %02d")
>            (set (make-local-variable 'time-stamp-start) "^#\\+DATE:  
> +")
>            (set (make-local-variable 'time-stamp-end) "$")))
> --8<---------------cut here---------------end--------------->8---
>
> Of course, `time-stamp-format' may be changed according to your taste.
>
> Shouldn't be such a thing be the default?


DATE was implemented exactly to specify a fixed date.  You can get
the modification date with

     {{{modification-time(%Y-%m-%d)}}}

and the current date with

     {{{date(%Y-%m-%d)}}}

These will be expanded upon export.  So you can, in fact, do

     #+DATE: {{{modification-time(%Y-%m-%d)}}}

HTH

- Carsten

  reply	other threads:[~2009-08-20 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  9:12 File modification date Sébastien Vauban
2009-08-20 20:04 ` Carsten Dominik [this message]
2009-12-07 13:58   ` Sébastien Vauban
     [not found]     ` <877hsyzy0t.fsf-pwAqS3aGAJQybS5Ee8rs3A@public.gmane.org>
2009-12-07 16:13       ` Francesco Pizzolante
2009-08-20 22:32 ` Eric S Fraga, 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=6B3BF818-A26F-47A9-9874-D763894513D1@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.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).