From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: File modification date Date: Thu, 20 Aug 2009 21:04:39 +0100 Message-ID: <6B3BF818-A26F-47A9-9874-D763894513D1@gmail.com> References: <87r5v6kfvt.fsf@mundaneum.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeDsQ-0003df-B7 for emacs-orgmode@gnu.org; Thu, 20 Aug 2009 16:04:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeDsL-0003bp-Pv for emacs-orgmode@gnu.org; Thu, 20 Aug 2009 16:04:50 -0400 Received: from [199.232.76.173] (port=59166 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeDsL-0003bl-NT for emacs-orgmode@gnu.org; Thu, 20 Aug 2009 16:04:45 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:58309) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeDsL-0005To-8X for emacs-orgmode@gnu.org; Thu, 20 Aug 2009 16:04:45 -0400 Received: by ewy7 with SMTP id 7so172441ewy.31 for ; Thu, 20 Aug 2009 13:04:44 -0700 (PDT) In-Reply-To: <87r5v6kfvt.fsf@mundaneum.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?ISO-8859-1?Q?S=E9bastien_Vauban?= Cc: emacs-orgmode@gnu.org On Aug 20, 2009, at 10:12 AM, S=E9bastien Vauban wrote: > Hi, > > I've always found the DATE header to be kind of useless, as it only =20= > indicates > the creation date of the file. > > For me, it would be better if it would be the last edit date as it =20 > 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-=20 > %02d") > (set (make-local-variable 'time-stamp-start) "^#\\+DATE: =20= > +") > (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