From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: short timestamp in org-log-note-headings Date: Sat, 8 Oct 2011 18:01:18 +0200 Message-ID: <4A81E0E2-0BB7-46A4-A371-F4BD3AF018F2@gmail.com> References: <878vow9684.fsf@hecubus.retroj.net> <03B09C0B-D005-4DDD-A822-8EAE675877E4@gmail.com> <87ty7kok0n.fsf@hecubus.retroj.net> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCZL3-00064h-PW for emacs-orgmode@gnu.org; Sat, 08 Oct 2011 12:01:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RCZL2-0001W7-5l for emacs-orgmode@gnu.org; Sat, 08 Oct 2011 12:01:25 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:54604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCZL1-0001Vg-TE for emacs-orgmode@gnu.org; Sat, 08 Oct 2011 12:01:24 -0400 Received: by wyh15 with SMTP id 15so1682324wyh.0 for ; Sat, 08 Oct 2011 09:01:22 -0700 (PDT) In-Reply-To: <87ty7kok0n.fsf@hecubus.retroj.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John J Foerch Cc: emacs-orgmode@gnu.org Accepted, thanks. - Carsten On 7.10.2011, at 18:15, John J Foerch wrote: > Carsten Dominik writes: >> Sure, please make a patch! >>=20 >> - Carsten >>=20 >> On 7.10.2011, at 17:22, John J Foerch wrote: >>=20 >>> Hello, >>>=20 >>> I wonder if a format code could be added for org-log-note-headings = that >>> allows the insertion of a short timestamp (without clock time). The = use >>> case for this is that I log state changes of to-do items, but the >>> precise time of the state change is usually more information than I = want >>> to record. >>>=20 >>> Thank you >>>=20 >>> --=20 >>> John Foerch >>>=20 >>>=20 >=20 > Okay, here it is. This patch adds %d and %D, the capitalized form for > an active timestamp, corresponding to %t and %T. The reason I thought > of 'd' as the code is the mnemonic "date". >=20 > --=20 > John Foerch >=20 >=20 > =46rom 746ab08868ab88dc3d942bada9a21b21cc3e6de2 Mon Sep 17 00:00:00 = 2001 > From: John Foerch > Date: Fri, 7 Oct 2011 12:09:22 -0400 > Subject: [PATCH] org-log-note-headings: format codes %d and %D >=20 > Two new format codes support insertion of a short-format time stamp. > %d for an inactive time stamp, and %D for an active one. > --- > lisp/org.el | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) >=20 > diff --git a/lisp/org.el b/lisp/org.el > index 4a11fc0..00cc7e0 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -2375,6 +2375,8 @@ context, and the cdr is the heading to be used. = The heading may also be the > empty string. > %t in the heading will be replaced by a time stamp. > %T will be an active time stamp instead the default inactive one > +%d will be replaced by a short-format time stamp. > +%D will be replaced by an active short-format time stamp. > %s will be replaced by the new TODO state, in double quotes. > %S will be replaced by the old TODO state, in double quotes. > %u will be replaced by the user name. > @@ -12174,6 +12176,12 @@ EXTRA is additional text that will be = inserted into the notes buffer." > (cons "%T" (format-time-string > (org-time-stamp-format 'long nil) > org-log-note-effective-time)) > + (cons "%d" (format-time-string > + (org-time-stamp-format nil 'inactive) > + org-log-note-effective-time)) > + (cons "%D" (format-time-string > + (org-time-stamp-format nil nil) > + org-log-note-effective-time)) > (cons "%s" (if org-log-note-state > (concat "\"" org-log-note-state "\"") > "")) > --=20 > 1.7.6.3 >=20