Fix org-ql-refile so that it handles all possible values for org-refile-targets
As per the documentation of `org-refile-targets`, each specification of the files in a given cons cell can be a list of files "or a symbol whose function or variable value will be used..." This ensures `org-refile-targets` can handle the case where the specification is a symbol with a variable value.
This commit is contained in:
parent
98c62ab0a6
commit
95dd23ee92
1 changed files with 5 additions and 3 deletions
|
|
@ -117,7 +117,10 @@ which see (but only the files are used)."
|
|||
(cl-loop for (files-spec . _candidate-spec) in org-refile-targets
|
||||
append (cl-typecase files-spec
|
||||
(null (list (current-buffer)))
|
||||
(symbol (pcase (funcall files-spec)
|
||||
(function (pcase (funcall files-spec)
|
||||
((and (pred stringp) file) (list file))
|
||||
((and (pred listp) files) files)))
|
||||
(symbol (pcase (eval files-spec)
|
||||
((and (pred stringp) file) (list file))
|
||||
((and (pred listp) files) files)))
|
||||
(list files-spec)))))))
|
||||
|
|
@ -136,7 +139,6 @@ which see (but only the files are used)."
|
|||
nil
|
||||
;; Position
|
||||
marker))))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-ql-find-in-agenda ()
|
||||
"Call `org-ql-find' on `org-agenda-files'."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue