diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2016-11-07 10:41:54 +0100 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2016-11-07 10:41:54 +0100 |
commit | ec84430cf4e09ba25ec675debdf802bc28111e06 (patch) | |
tree | 9c64bc8a0cd5e8cac82aa5fdf369d40529f140f8 /contrib/lisp/org-notmuch.el | |
parent | 84539dca3aa301ecfe48858eceef1ced0505388b (diff) |
Imported Upstream version 9.0
Diffstat (limited to 'contrib/lisp/org-notmuch.el')
-rw-r--r-- | contrib/lisp/org-notmuch.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/contrib/lisp/org-notmuch.el b/contrib/lisp/org-notmuch.el index 712ec5a..65d7550 100644 --- a/contrib/lisp/org-notmuch.el +++ b/contrib/lisp/org-notmuch.el @@ -65,21 +65,23 @@ Should accept a notmuch search string as the sole argument." ;; Install the link type -(org-add-link-type "notmuch" 'org-notmuch-open) -(add-hook 'org-store-link-functions 'org-notmuch-store-link) +(org-link-set-parameters "notmuch" + :follow #'org-notmuch-open + :store #'org-notmuch-store-link) (defun org-notmuch-store-link () "Store a link to a notmuch search or message." (when (eq major-mode 'notmuch-show-mode) - (let* ((message-id (notmuch-show-get-prop :id)) + (let* ((message-id (notmuch-show-get-message-id t)) (subject (notmuch-show-get-subject)) (to (notmuch-show-get-to)) (from (notmuch-show-get-from)) + (date (org-trim (notmuch-show-get-date))) desc link) - (org-store-link-props :type "notmuch" :from from :to to + (org-store-link-props :type "notmuch" :from from :to to :date date :subject subject :message-id message-id) (setq desc (org-email-link-description)) - (setq link (concat "notmuch:" "id:" message-id)) + (setq link (concat "notmuch:id:" message-id)) (org-add-link-props :link link :description desc) link))) @@ -92,13 +94,13 @@ Should accept a notmuch search string as the sole argument." Can link to more than one message, if so all matching messages are shown." (require 'notmuch) - (notmuch-show (org-link-unescape search))) - + (notmuch-show search)) -(org-add-link-type "notmuch-search" 'org-notmuch-search-open) -(add-hook 'org-store-link-functions 'org-notmuch-search-store-link) +(org-link-set-parameters "notmuch-search" + :follow #'org-notmuch-search-open + :store #'org-notmuch-search-store-link) (defun org-notmuch-search-store-link () "Store a link to a notmuch search or message." |