diff --git a/lisp/org.el b/lisp/org.el index 13ad44b7c..e009cb62c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -672,7 +672,7 @@ on a string that terminates immediately after the date.") The time stamps may be either active or inactive.") (defconst org-repeat-re - "[[<][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^]>\n]*?\ + "<[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9] [^>\n]*?\ \\([.+]?\\+[0-9]+[hdwmy]\\(/[0-9]+[hdwmy]\\)?\\)" "Regular expression for specifying repeated events. After a match, group 1 contains the repeat expression.") @@ -3005,6 +3005,11 @@ property to one or more of these keywords." (const :tag "Force recording the DONE state" time) (const :tag "Force recording a note with the DONE state" note))) +(defcustom org-todo-repeat-hook nil + "Hook that is run after a task has been repeated." + :package-version '(Org . "9.2") + :group 'org-todo + :type 'hook) (defgroup org-priorities nil "Priorities in Org mode." @@ -12758,6 +12763,7 @@ enough to shift date past today. Continue? " (org-timestamp-change n (cdr (assoc what whata)) nil t)) (setq msg (concat msg type " " org-last-changed-timestamp " "))))))) + (run-hooks 'org-todo-repeat-hook) (setq org-log-post-message msg) (message msg)))) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index db34a03c2..02b025758 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -6650,8 +6650,8 @@ Paragraph" (org-test-with-temp-text "* TODO H\n<2012-03-29 Thu +2h>" (org-todo "DONE") (buffer-string)))) - ;; Also repeat inactive time stamps with a repeater. - (should + ;; Do not repeat inactive time stamps with a repeater. + (should-not (string-match-p "\\[2014-03-29 .* \\+2y\\]" (let ((org-todo-keywords '((sequence "TODO" "DONE"))))