From c14f45d18636df6c3b5ca74e68015a2a2e26c11d Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 14 Feb 2018 22:06:42 +0100 Subject: [PATCH] [Org] Exclude refiling targets with DONE states Copied from http://doc.norang.ca/org-mode.html#Refiling --- site-lisp/db-org.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 3484274..8af0f02 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -710,6 +710,13 @@ _y_: ?y? year _q_: quit _L__l__c_: ?l? (setq org-indirect-buffer-display 'current-window) (setq org-outline-path-complete-in-steps nil) +; 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))) + +(setq org-refile-target-verify-function 'db/verify-refile-target) + ;;; Babel