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.
This commit is contained in:
David Maus 2010-07-09 10:42:30 +00:00 committed by Carsten Dominik
parent fb29271143
commit 4c1b83e899
1 changed files with 2 additions and 1 deletions

View File

@ -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)