From 4c1b83e8995f872d68dfde2df513ef7466f6d5e1 Mon Sep 17 00:00:00 2001 From: David Maus Date: Fri, 9 Jul 2010 10:42:30 +0000 Subject: [PATCH] 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. --- lisp/org-capture.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 8b6bd0393..7648167d6 100644 --- a/lisp/org-capture.el +++ b/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) -- 2.11.4.GIT