Browse Source

Revert "org-capture: Remove forbidden value type from "file" templates"

This reverts commit 5485170263a46fa17db67b0324c4c4e48bcdfe49.
Nicolas Goaziou 3 years ago
parent
commit
c81f9fff3b
1 changed files with 6 additions and 3 deletions
  1. 6 3
      lisp/org-capture.el

+ 6 - 3
lisp/org-capture.el

@@ -1008,13 +1008,16 @@ Store them in the capture property list."
 
 (defun org-capture-expand-file (file)
   "Expand functions and symbols for FILE.
-When FILE is a function, call it.  When it is a variable,
-retrieve its value.  When it is the empty string, return
-`org-default-notes-file'.  In any other case, return FILE as-is."
+When FILE is a function, call it.  When it is a form, evaluate
+it.  When it is a variable, retrieve the value.  When it is
+a string, return it.  However, if it is the empty string, return
+`org-default-notes-file' instead."
   (cond
    ((equal file "") org-default-notes-file)
+   ((org-string-nw-p file) file)
    ((functionp file) (funcall file))
    ((and (symbolp file) (boundp file)) (symbol-value file))
+   ((consp file) (eval file))
    (t file)))
 
 (defun org-capture-target-buffer (file)