From 1ec3748fc43777e753892e24b799a8e10a7799fa Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 27 Jun 2025 16:49:32 +0200 Subject: [PATCH] Prevent accidental refiling to HOLD headings Headings with inherited tag HOLD are not shown on any agenda and thus risk being overlooked. Try to prevent this by disallowing any heading tagged with HOLD (local or inherited) as refile target. --- site-lisp/db-org.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 108f670..d89eec2 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -472,7 +472,10 @@ Via %%(with-temp-buffer (db/org-add-link-to-current-clock) (string-trim (buffer- (and ;; Exclude DONE state tasks from refile targets (from bh) (not (member (nth 2 (org-heading-components)) - org-done-keywords)))) + org-done-keywords)) + ;; Exclude HOLD items to prevent accidental refiling to such headings (they will not appear on + ;; any agenda when a super-item is tagged with :HOLD:. + (not (member "HOLD" (org-get-tags (point)))))) ;;; Helper Functions for Clocking