Browse Source

org-capture: Fix "org-find-olp: Wrong type argument: stringp, nil"

* lisp/org-capture.el (org-capture-expand-file): Empyt string defaults
  to `org-default-notes-file'.
* lisp/org.el (org-default-notes-file): Do not fallback on
`remember-data-file' since "org-capture.el" is not based off
"remember.el" anymore.

Reported-by: Florian Lindner <mailinglists@xgm.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/97448>
Nicolas Goaziou 10 years ago
parent
commit
b27e630bab
2 changed files with 6 additions and 5 deletions
  1. 5 2
      lisp/org-capture.el
  2. 1 3
      lisp/org.el

+ 5 - 2
lisp/org-capture.el

@@ -966,12 +966,15 @@ 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 form, evaluate
-it.  When it is a variable, retrieve the value.  Return whatever we get."
+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))
-   ((and file (consp file)) (eval file))
+   ((consp file) (eval file))
    (t file)))
 
 (defun org-capture-target-buffer (file)

+ 1 - 3
lisp/org.el

@@ -2315,9 +2315,7 @@ Used as a fall back file for org-capture.el, for templates that
 do not specify a target file."
   :group 'org-refile
   :group 'org-capture
-  :type '(choice
-	  (const :tag "Default from remember-data-file" nil)
-	  file))
+  :type 'file)
 
 (defcustom org-goto-interface 'outline
   "The default interface to be used for `org-goto'.