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'.
This commit is contained in:
Nicolas Goaziou 2016-01-11 12:03:53 +01:00
parent 157f91c31c
commit 9db78611b4
3 changed files with 11 additions and 4 deletions

View File

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

View File

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

View File

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