[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] File modification date
From: |
Carsten Dominik |
Subject: |
Re: [Orgmode] File modification date |
Date: |
Thu, 20 Aug 2009 21:04:39 +0100 |
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