diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-06-23 16:21:22 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-06-23 16:21:22 +0200 |
commit | fb46cf11d315f5c6a4cbba717137362216cb0e2f (patch) | |
tree | 9a7014f09e1b499c2785c9e1db04afc9851f1ea6 | |
parent | 99e7f33f0aa4a364f931aab31dd3494cca24f135 (diff) | |
download | org-mode-fb46cf11d315f5c6a4cbba717137362216cb0e2f.tar.gz |
Make the link properties from org-protocol work in capture
-rw-r--r-- | lisp/org-capture.el | 8 | ||||
-rw-r--r-- | lisp/org-protocol.el | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index c47cdf4..19df17e 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 88676f4..a02a170 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))) |