From ec84430cf4e09ba25ec675debdf802bc28111e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Mon, 7 Nov 2016 10:41:54 +0100 Subject: Imported Upstream version 9.0 --- contrib/lisp/org-notmuch.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'contrib/lisp/org-notmuch.el') 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." -- cgit v1.2.3