emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Check if `org-capture-link-is-already-stored' is bound


From: David Maus
Subject: [Orgmode] [PATCH] Check if `org-capture-link-is-already-stored' is bound before evaluating.
Date: Fri, 9 Jul 2010 07:42:30 +0200

* 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 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 2b02b77..9ba02e2 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -372,7 +372,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)
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]