Do not refile to elements of periodic tasks

If separate things should be done, generate a separate item for it, or leave
some note at the corresponding series element.  Periodic tasks are quite rigid
and should not be used for collecting individual subtasks.
This commit is contained in:
Daniel - 2020-07-04 11:43:19 +02:00
parent b5b16a3791
commit 4084e0ccae
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 9 additions and 4 deletions

View File

@ -245,11 +245,16 @@ In ~%s~:
;;; Refiling
;; Exclude DONE state tasks from refile targets (from bh)
(defun db/verify-refile-target ()
"Exclude todo keywords with a done state from refile targets"
(not (member (nth 2 (org-heading-components))
org-done-keywords)))
"Verify that a certain location is eligible as a refile target.
In other words, exclude tasks with a done state and those with
tag PERIODIC."
(and
;; Exclude DONE state tasks from refile targets (from bh)
(not (member (nth 2 (org-heading-components))
org-done-keywords))
;; Don't refile to elements of periodic tasks
(not (member "PERIODIC" (org-get-tags)))))
;;; Reset checklists