From 3020f0059b14bcd625e3874b351c8aa5561736b1 Mon Sep 17 00:00:00 2001 From: Adam Bliss Date: Thu, 4 Jan 2018 18:59:37 +0000 Subject: [PATCH 1/2] Add date field to org-notmuch-store-link. This allows a `%d` in `org-email-link-description` to function correctly. --- contrib/lisp/org-notmuch.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/lisp/org-notmuch.el b/contrib/lisp/org-notmuch.el index 0affd71cb..a82dbc47e 100644 --- a/contrib/lisp/org-notmuch.el +++ b/contrib/lisp/org-notmuch.el @@ -54,9 +54,11 @@ (subject (notmuch-show-get-subject)) (to (notmuch-show-get-to)) (from (notmuch-show-get-from)) + (date (notmuch-show-get-date)) desc link) (org-store-link-props :type "notmuch" :from from :to to - :subject subject :message-id message-id) + :subject subject :message-id message-id + :date date) (setq desc (org-email-link-description)) (setq link (concat "notmuch:" "id:" message-id)) (org-add-link-props :link link :description desc) From ab3be13433774bb05ec3fffff8be64685583d3c8 Mon Sep 17 00:00:00 2001 From: Adam Bliss Date: Thu, 4 Jan 2018 19:37:41 +0000 Subject: [PATCH 2/2] Also add ...timestamp[-inactive] to notmuch-store-link. This enables the corresponding extended keyword replacements in `org-capture-templates`. (This code was copied verbatim from org-gnus.el.) --- contrib/lisp/org-notmuch.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/contrib/lisp/org-notmuch.el b/contrib/lisp/org-notmuch.el index a82dbc47e..1abb13d67 100644 --- a/contrib/lisp/org-notmuch.el +++ b/contrib/lisp/org-notmuch.el @@ -55,10 +55,21 @@ (to (notmuch-show-get-to)) (from (notmuch-show-get-from)) (date (notmuch-show-get-date)) + (date-ts (and date + (ignore-errors + (format-time-string + (org-time-stamp-format t) + (date-to-time date))))) + (date-ts-ia (and date + (ignore-errors + (format-time-string + (org-time-stamp-format t t) + (date-to-time date))))) desc link) (org-store-link-props :type "notmuch" :from from :to to :subject subject :message-id message-id - :date date) + :date date :date-timestamp date-ts + :date-timestamp-inactive date-ts-ia)) (setq desc (org-email-link-description)) (setq link (concat "notmuch:" "id:" message-id)) (org-add-link-props :link link :description desc)