Quellcode durchsuchen

Check if `org-capture-link-is-already-stored' is bound before evaluating.

* org-capture.el (org-capture): Check if
`org-capture-link-is-already-stored' is bound before evaluating.

If `org-protocol-capture' is the first function that calls
`org-capture', this variable is locally bound while it is globally
unbound. I.e. org-capture.el was not loaded before, the defvar not
evaluated.  If `org-protocol-capture' exits, Emacs restores the global
value, which is void.
David Maus vor 14 Jahren
Ursprung
Commit
4c1b83e899
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      lisp/org-capture.el

+ 2 - 1
lisp/org-capture.el

@@ -374,7 +374,8 @@ bypassed."
    (t
     ;; FIXME: Are these needed?
     (let* ((orig-buf (current-buffer))
-	   (annotation (if org-capture-link-is-already-stored
+	   (annotation (if (and (boundp 'org-capture-link-is-already-stored)
+				org-capture-link-is-already-stored)
 			   (plist-get org-store-link-plist :annotation)
 			 (org-store-link nil)))
 	   (initial (and (org-region-active-p)