Use inactive timestamps when re-scheduling or re-deadlining

* lisp/org.el (org-log-note-headings): Improve docstring.
(org-store-log-note): When re-scheduling or re-deadlining, convert old
or new timestamp to an inactive one so as to not clutter the agenda.

Reported-by:  Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/93498>
This commit is contained in:
Nicolas Goaziou 2015-06-29 22:19:38 +02:00
parent cedef74216
commit 304f84530b
1 changed files with 33 additions and 19 deletions

View File

@ -2890,20 +2890,23 @@ When nil, only the date will be recorded."
(refile . "Refiled on %t") (refile . "Refiled on %t")
(clock-out . "")) (clock-out . ""))
"Headings for notes added to entries. "Headings for notes added to entries.
The value is an alist, with the car being a symbol indicating the note
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.
%U will be replaced by the full user name.
In fact, it is not a good idea to change the `state' entry, because The value is an alist, with the car being a symbol indicating the
agenda log mode depends on the format of these entries." note context, and the cdr is the heading to be used. The heading
may also be the empty string. The following placeholders can be
used:
%t a time stamp.
%T an active time stamp instead the default inactive one
%d a short-format time stamp.
%D an active short-format time stamp.
%s the new TODO state or time stamp (inactive), in double quotes.
%S the old TODO state or time stamp (inactive), in double quotes.
%u the user name.
%U full user name.
In fact, it is not a good idea to change the `state' entry,
because Agenda Log mode depends on the format of these entries."
:group 'org-todo :group 'org-todo
:group 'org-progress :group 'org-progress
:type '(list :greedy t :type '(list :greedy t
@ -13694,12 +13697,23 @@ EXTRA is additional text that will be inserted into the notes buffer."
(cons "%D" (format-time-string (cons "%D" (format-time-string
(org-time-stamp-format nil nil) (org-time-stamp-format nil nil)
org-log-note-effective-time)) org-log-note-effective-time))
(cons "%s" (if org-log-note-state (cons "%s" (cond
(concat "\"" org-log-note-state "\"") ((not org-log-note-state) "")
"")) ((org-string-match-p org-ts-regexp
(cons "%S" (if org-log-note-previous-state org-log-note-state)
(concat "\"" org-log-note-previous-state "\"") (format "\"[%s]\""
"\"\""))))) (substring org-log-note-state 1 -1)))
(t (format "\"%s\"" org-log-note-state))))
(cons "%S"
(cond
((not org-log-note-previous-state) "")
((org-string-match-p org-ts-regexp
org-log-note-previous-state)
(format "\"[%s]\""
(substring
org-log-note-previous-state 1 -1)))
(t (format "\"%s\""
org-log-note-previous-state)))))))
(when lines (setq note (concat note " \\\\"))) (when lines (setq note (concat note " \\\\")))
(push note lines)) (push note lines))
(when (or current-prefix-arg org-note-abort) (when (or current-prefix-arg org-note-abort)