diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index af0abed..cd1951c 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -294,13 +294,19 @@ In ~%s~: ;;; Refiling (defun db/verify-refile-target () - "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." + "Verify that a certain location is eligible as a refile target." (and ;; Exclude DONE state tasks from refile targets (from bh) (not (member (nth 2 (org-heading-components)) - org-done-keywords)))) + org-done-keywords)) + ;; Exclude NOTE entries in `db/org-default-org-file', as those are project + ;; notes that should not have proper tasks as children (use links to connect + ;; those tasks to the project notes instead) + (not (and (member "NOTE" (org-get-tags)) + (not (null (buffer-file-name))) + (not (null db/org-default-org-file)) + (file-equal-p (buffer-file-name) + db/org-default-org-file))))) ;;; Reset checklists