From fb46cf11d315f5c6a4cbba717137362216cb0e2f Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 23 Jun 2010 16:21:22 +0200 Subject: [PATCH] Make the link properties from org-protocol work in capture --- lisp/org-capture.el | 8 +++++++- lisp/org-protocol.el | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index c47cdf443..19df17e98 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -64,6 +64,10 @@ (defvar org-capture-last-stored-marker (make-marker) "Marker pointing to the entry most recently stored with `org-capture'.") +;; The following variable is scoped dynamically by org-protocol +;; to indicate that the link properties have already been stored +(defvar org-capture-link-is-already-stored nil) + (defgroup org-capture nil "Options concerning capturing new entries." :tag "Org Capture" @@ -348,7 +352,9 @@ bypassed." ;; set temporary variables that will be needed in ;; `org-select-remember-template' (let* ((orig-buf (current-buffer)) - (annotation (org-store-link nil)) + (annotation (if org-capture-link-is-already-stored + (plist-get org-store-link-plist :annotation) + (org-store-link nil))) (initial (and (org-region-active-p) (buffer-substring (point) (mark)))) (entry (org-capture-select-template keys))) diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 88676f45d..a02a17097 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -503,6 +503,7 @@ CAPTURE-FUNC is either the symbol `org-remember' or `org-capture'." (region (or (caddr parts) "")) (orglink (org-make-link-string url (if (string-match "[^[:space:]]" title) title url))) + (org-capture-link-is-already-stored t) ;; avoid call to org-store-link remember-annotation-functions) (setq org-stored-links (cons (list url title) org-stored-links)) @@ -510,6 +511,7 @@ CAPTURE-FUNC is either the symbol `org-remember' or `org-capture'." (org-store-link-props :type type :link url :description title + :annotation orglink :initial region) (raise-frame) (funcall capture-func nil template))) -- 2.11.4.GIT