From 12e73e58af9881faf5aba52db68798c16cff22c0 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 14 Apr 2010 13:49:03 +0200 Subject: [PATCH] Only record LAST_REPEAT if it makes sense. The definition of "makes sense is here: - either the user is logging repeats (org-log-repeat) - or the entry contains clock data, in which case the LAST_REPEAT is needed to display clocking time properly. Request by Dan Griswold, with some support from Bernt Hansen --- lisp/ChangeLog | 4 ++++ lisp/org.el | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1cd526cb..add1dda42 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2010-04-14 Carsten Dominik + * org.el (org-auto-repeat-maybe): Only record LAST_REPEAT if + org-log-repeat is non-nil, or if there is clocking data in the + entry. + * org-crypt.el (org-encrypt-entry): Improve mapping behavior. 2010-04-13 Carsten Dominik diff --git a/lisp/org.el b/lisp/org.el index fd4711919..50a7df033 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10868,8 +10868,9 @@ This function is run automatically after each state change to a DONE state." (unless (and to-state (member to-state org-todo-keywords-1)) (setq to-state (if (eq interpret 'type) last-state head))) (org-todo to-state) - (org-entry-put nil "LAST_REPEAT" (format-time-string - (org-time-stamp-format t t))) + (when (or org-log-repeat (org-entry-get nil "CLOCK")) + (org-entry-put nil "LAST_REPEAT" (format-time-string + (org-time-stamp-format t t)))) (when org-log-repeat (if (or (memq 'org-add-log-note (default-value 'post-command-hook)) (memq 'org-add-log-note post-command-hook)) -- 2.11.4.GIT