From 4084e0ccae987fb251250b5f8ada34d5f54c10d9 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 4 Jul 2020 11:43:19 +0200 Subject: [PATCH] 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. --- site-lisp/db-org.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index d241c48..2777ff4 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -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