Browse Source

Tweak `org-auto-repeat-maybe'

* lisp/org.el (org-auto-repeat-maybe): Only clear non-repeated SCHEDULED
  information in a repeated task.

* doc/org.texi (Repeated tasks): Document behavior.

Do not clear non-repeated DEADLINE information however, as it could be
a global deadline for all occurrences of the task.  Also, this case is
taken care of by `org-agenda-skip-scheduled-if-deadline-is-shown' with
a value set to `repeated-after-deadline'.
Nicolas Goaziou 9 years ago
parent
commit
9db78611b4
3 changed files with 11 additions and 4 deletions
  1. 3 1
      doc/org.texi
  2. 5 0
      etc/ORG-NEWS
  3. 3 3
      lisp/org.el

+ 3 - 1
doc/org.texi

@@ -6429,7 +6429,9 @@ You may have both scheduling and deadline information for a specific task.
 If the repeater is set for the scheduling information only, you probably want
 the repeater to be ignored after the deadline.  If so, set the variable
 @code{org-agenda-skip-scheduled-if-deadline-is-shown} to
-@code{repeated-after-deadline}.  If you want both scheduling and deadline
+@code{repeated-after-deadline}.  However, any scheduling information without
+a repeater is no longer relevant once the task is done, and thus, removed
+upon repeating the task.  If you want both scheduling and deadline
 information to repeat after the same interval, set the same repeater for both
 timestamps.
 

+ 5 - 0
etc/ORG-NEWS

@@ -169,6 +169,11 @@ for details.
 *** org-bbdb-anniversaries-future
 Used like org-bbdb-anniversaries, it provides a few days warning
 for upcoming anniversaries (default: 7 days).
+*** Clear non-repeated SCHEDULED upon repeating a task
+If the task is repeated, and therefore done at least one, scheduling
+information is no longer relevant.  It is therefore removed.
+
+See [[git:481719fbd5751aaa9c672b762cb43aea8ee986b0][commit message]] for more information.
 *** Support for ISO week trees
 ISO week trees are an alternative date tree format that orders entries
 by ISO week and not by month.

+ 3 - 3
lisp/org.el

@@ -13143,9 +13143,9 @@ This function is run automatically after each state change to a DONE state."
 	    (cond
 	     ((not (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts))
 	      ;; Time-stamps without a repeater are usually skipped.
-	      ;; However, a SCHEDULED or DEADLINE time-stamp without
-	      ;; one is removed, as it is considered outdated.
-	      (unless (equal type "Plain:")
+	      ;; However, a SCHEDULED time-stamp without one is
+	      ;; removed, as it is considered as no longer relevant.
+	      (when (equal type org-scheduled-string)
 		(org-remove-timestamp-with-keyword type)))
 	     (t
 	      (let ((n (string-to-number (match-string 2 ts)))