Emacs Org mode: clear non-repeating SCHEDULED times when DEADLINE repeats

I use org-mode to manage some deadlines for repetitive tasks. For example, I might have something like the following:

* TODO My Weekly Task DEADLINE <2013-08-10 Sat +1w> 

If I mark the task as DONE, then the deadline automatically increases until the next week, as expected. However, I would also like to use the SCHEDULED value to indicate when during the week I would like to complete this task, for example:

 * TODO My Weekly Task DEADLINE <2013-08-10 Sat +1w> SCHEDULED: <2013-08-08 Thu> 

This makes the task appear on the agenda for today (Thursday). However, when I mark the DONE task, I get the following:

 * TODO My Weekly Task DEADLINE <2013-08-17 Sat +1w> SCHEDULED: <2013-08-08 Thu> 

... and the task still appears on the agenda for today, although it is completed.

Is it possible that for tasks that have repeated DEADLINE, get Org-Mode to clear a non-repeating SCHEDULED date?

+4
source share
1 answer

Here's the patch if you want to apply it yourself. I will send another copy to the org-mode mailing list.

 --- a/lisp/org.el +++ b/lisp/org.el @@ -12835,7 +12835,8 @@ This function is run automatically after each state change to a DONE state." (setq type (if (match-end 1) org-scheduled-string (if (match-end 3) org-deadline-string "Plain:")) ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0)))) - (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts) + (if (not (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts)) + (org-remove-timestamp-with-keyword org-scheduled-string) (setq n (string-to-number (match-string 2 ts)) what (match-string 3 ts)) (if (equal what "w") (setq n (* n 7) what "d")) 
+5
source

Source: https://habr.com/ru/post/1495928/


All Articles