From 82350755149be49184952f8f578158cd909859a7 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 2 Apr 2009 17:27:52 +0200 Subject: [PATCH] Remember: Take annotation and initial from plist, if defined. The annotation and initial contents for a remember template are normally taken from the variables `annotation' and `initial', which are bound by remember. We now also check the property list for such values, so that the link generating routine can force the right values in there. --- lisp/ChangeLog | 3 +++ lisp/org-remember.el | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 571223b42..fd0a1e388 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-04-02 Carsten Dominik + * org-remember.el (org-remember-apply-template): Take the default + for the annotation from the :annotation property. + * org-mac-message.el (org-mac-message-get-link): Remove the quotes. (org-mac-message-get-link): Return the result. diff --git a/lisp/org-remember.el b/lisp/org-remember.el index c86d1f93a..43d3cc447 100644 --- a/lisp/org-remember.el +++ b/lisp/org-remember.el @@ -386,11 +386,16 @@ to be run from that hook to function properly." (v-T (format-time-string (cdr org-time-stamp-formats) ct)) (v-u (concat "[" (substring v-t 1 -1) "]")) (v-U (concat "[" (substring v-T 1 -1) "]")) - ;; `initial' and `annotation' are bound in `remember' - (v-i (if (boundp 'initial) initial)) - (v-a (if (and (boundp 'annotation) annotation) - (if (equal annotation "[[]]") "" annotation) - "")) + ;; `initial' and `annotation' are bound in `remember'. + ;; But if the property list has them, we prefer those values + (v-i (or (plist-get org-store-link-plist :initial) + (and (boundp 'initial) initial) + "")) + (v-a (or (plist-get org-store-link-plist :annotation) + (and (boundp 'annotation) annotation) + "")) + ;; Is the link empty? Then we do not want it... + (v-a (if (equal v-a "[[]]") "" v-a)) (clipboards (remove nil (list v-i (org-get-x-clipboard 'PRIMARY) (org-get-x-clipboard 'CLIPBOARD) @@ -418,10 +423,11 @@ to be run from that hook to function properly." (when (and file (not (file-name-absolute-p file))) (setq file (expand-file-name file org-directory))) - (setq org-store-link-plist - (append (list :annotation v-a :initial v-i) - org-store-link-plist)) + (plist-put org-store-link-plist :annotation v-a) + org-store-link-plist + (plist-put org-store-link-plist :initial v-i)) + (unless tpl (setq tpl "") (message "No template") (ding) (sit-for 1)) (erase-buffer) (insert (substitute-command-keys