Browse Source

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
Carsten Dominik 15 năm trước cách đây
mục cha
commit
12e73e58af
2 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 4 0
      lisp/ChangeLog
  2. 3 2
      lisp/org.el

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2010-04-14  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* 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  <carsten.dominik@gmail.com>

+ 3 - 2
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))