From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [PATCH] Check if `org-capture-link-is-already-stored' is bound before evaluating. Date: Fri, 9 Jul 2010 07:42:30 +0200 Message-ID: <1278654150-28556-1-git-send-email-dmaus@ictsoc.de> Return-path: Received: from [140.186.70.92] (port=39411 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OX6Mc-0001Uc-J1 for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 01:43:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OX6Ma-0004jU-HB for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 01:43:06 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:57564) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OX6Ma-0004jE-8j for emacs-orgmode@gnu.org; Fri, 09 Jul 2010 01:43:04 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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