emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* short timestamp in org-log-note-headings
@ 2011-10-07 15:22 John J Foerch
  2011-10-07 15:37 ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: John J Foerch @ 2011-10-07 15:22 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

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.

Thank you

-- 
John Foerch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: short timestamp in org-log-note-headings
  2011-10-07 15:22 short timestamp in org-log-note-headings John J Foerch
@ 2011-10-07 15:37 ` Carsten Dominik
  2011-10-07 16:15   ` John J Foerch
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2011-10-07 15:37 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode

Sure, please make a patch!

- Carsten

On 7.10.2011, at 17:22, John J Foerch wrote:

> Hello,
> 
> 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.
> 
> Thank you
> 
> -- 
> John Foerch
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: short timestamp in org-log-note-headings
  2011-10-07 15:37 ` Carsten Dominik
@ 2011-10-07 16:15   ` John J Foerch
  2011-10-07 16:41     ` Michael Brand
  2011-10-08 16:01     ` Carsten Dominik
  0 siblings, 2 replies; 6+ messages in thread
From: John J Foerch @ 2011-10-07 16:15 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

Carsten Dominik <carsten.dominik@gmail.com> writes:
> Sure, please make a patch!
>
> - Carsten
>
> On 7.10.2011, at 17:22, John J Foerch wrote:
>
>> Hello,
>> 
>> 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.
>> 
>> Thank you
>> 
>> -- 
>> John Foerch
>> 
>> 

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".

-- 
John Foerch



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-log-note-headings add %d and %D --]
[-- Type: text/x-diff, Size: 1611 bytes --]

From 746ab08868ab88dc3d942bada9a21b21cc3e6de2 Mon Sep 17 00:00:00 2001
From: John Foerch <jjfoerch@earthlink.net>
Date: Fri, 7 Oct 2011 12:09:22 -0400
Subject: [PATCH] org-log-note-headings: format codes %d and %D

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(-)

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 "\"")
 				""))
-- 
1.7.6.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: short timestamp in org-log-note-headings
  2011-10-07 16:15   ` John J Foerch
@ 2011-10-07 16:41     ` Michael Brand
  2011-10-08 16:01     ` Carsten Dominik
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Brand @ 2011-10-07 16:41 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode

Hi John

Thank you for this patch, this is exactly what I have been looking for
when I started to use logging. Because I did not realize how easy this
is to implement I had it only on my list for someday/maybe...

Michael

On Fri, Oct 7, 2011 at 18:15, John J Foerch <jjfoerch@earthlink.net> wrote:
> 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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: short timestamp in org-log-note-headings
  2011-10-07 16:15   ` John J Foerch
  2011-10-07 16:41     ` Michael Brand
@ 2011-10-08 16:01     ` Carsten Dominik
  2011-10-08 17:09       ` John J Foerch
  1 sibling, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2011-10-08 16:01 UTC (permalink / raw)
  To: John J Foerch; +Cc: emacs-orgmode

Accepted, thanks.

- Carsten
On 7.10.2011, at 18:15, John J Foerch wrote:

> Carsten Dominik <carsten.dominik@gmail.com> writes:
>> Sure, please make a patch!
>> 
>> - Carsten
>> 
>> On 7.10.2011, at 17:22, John J Foerch wrote:
>> 
>>> Hello,
>>> 
>>> 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.
>>> 
>>> Thank you
>>> 
>>> -- 
>>> John Foerch
>>> 
>>> 
> 
> 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".
> 
> -- 
> John Foerch
> 
> 
> From 746ab08868ab88dc3d942bada9a21b21cc3e6de2 Mon Sep 17 00:00:00 2001
> From: John Foerch <jjfoerch@earthlink.net>
> Date: Fri, 7 Oct 2011 12:09:22 -0400
> Subject: [PATCH] org-log-note-headings: format codes %d and %D
> 
> 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(-)
> 
> 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 "\"")
> 				""))
> -- 
> 1.7.6.3
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: short timestamp in org-log-note-headings
  2011-10-08 16:01     ` Carsten Dominik
@ 2011-10-08 17:09       ` John J Foerch
  0 siblings, 0 replies; 6+ messages in thread
From: John J Foerch @ 2011-10-08 17:09 UTC (permalink / raw)
  To: emacs-orgmode

Thank you, too

John Foerch

Carsten Dominik <carsten.dominik@gmail.com> writes:
> Accepted, thanks.
>
> - Carsten
> On 7.10.2011, at 18:15, John J Foerch wrote:
>
>> Carsten Dominik <carsten.dominik@gmail.com> writes:
>>> Sure, please make a patch!
>>> 
>>> - Carsten
>>> 
>>> On 7.10.2011, at 17:22, John J Foerch wrote:
>>> 
>>>> Hello,
>>>> 
>>>> 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.
>>>> 
>>>> Thank you
>>>> 
>>>> -- 
>>>> John Foerch
>>>> 
>>>> 
>> 
>> 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".
>> 
>> -- 
>> John Foerch
>> 
>> 
>> From 746ab08868ab88dc3d942bada9a21b21cc3e6de2 Mon Sep 17 00:00:00 2001
>> From: John Foerch <jjfoerch@earthlink.net>
>> Date: Fri, 7 Oct 2011 12:09:22 -0400
>> Subject: [PATCH] org-log-note-headings: format codes %d and %D
>> 
>> 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(-)
>> 
>> 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 "\"")
>> 				""))
>> -- 
>> 1.7.6.3
>> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-10-08 17:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07 15:22 short timestamp in org-log-note-headings John J Foerch
2011-10-07 15:37 ` Carsten Dominik
2011-10-07 16:15   ` John J Foerch
2011-10-07 16:41     ` Michael Brand
2011-10-08 16:01     ` Carsten Dominik
2011-10-08 17:09       ` John J Foerch

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).