emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jan Malakhovski <oxij@oxij.org>
To: emacs-orgmode@gnu.org
Cc: Jan Malakhovski <oxij@oxij.org>
Subject: [PATCH 2/2] org-notmuch: add date support to org-notmuch-store-link
Date: Sun, 27 Dec 2015 14:54:17 +0000	[thread overview]
Message-ID: <1451228057-12960-3-git-send-email-oxij@oxij.org> (raw)
In-Reply-To: <1451228057-12960-1-git-send-email-oxij@oxij.org>

* contrib/lisp/org-notmuch.el (org-notmuch-store-link): Add date support.
* doc/org.texi: Fix `org-capture-templates' documentation.
---
 contrib/lisp/org-notmuch.el | 7 ++++---
 doc/org.texi                | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/contrib/lisp/org-notmuch.el b/contrib/lisp/org-notmuch.el
index 712ec5a..265742e 100644
--- a/contrib/lisp/org-notmuch.el
+++ b/contrib/lisp/org-notmuch.el
@@ -71,15 +71,16 @@ Should accept a notmuch search string as the sole argument."
 (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)))
 
diff --git a/doc/org.texi b/doc/org.texi
index c3c5b4d..92ec29a 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -7304,7 +7304,7 @@ Link type                        |  Available keywords
 bbdb                             |  %:name %:company
 irc                              |  %:server %:port %:nick
 vm, vm-imap, wl, mh, mew, rmail, |  %:type %:subject %:message-id
-gnus                             |  %:from %:fromname %:fromaddress
+gnus, notmuch                    |  %:from %:fromname %:fromaddress
                                  |  %:to   %:toname   %:toaddress
                                  |  %:date @r{(message date header field)}
                                  |  %:date-timestamp @r{(date as active timestamp)}
-- 
2.6.4

  parent reply	other threads:[~2015-12-27 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-27 14:54 [PATCH v3 part2 0/2] date-timestamp* calculations Jan Malakhovski
2015-12-27 14:54 ` [PATCH 1/2] factor out date-timestamp* calculations to org-store-link-props Jan Malakhovski
2015-12-29 20:24   ` Nicolas Goaziou
2015-12-27 14:54 ` Jan Malakhovski [this message]
2015-12-29 20:24   ` [PATCH 2/2] org-notmuch: add date support to org-notmuch-store-link Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2015-10-25 13:36 [PATCH] remove some copy-paste and " Jan Malakhovski
2015-10-25 13:36 ` [PATCH 2/2] org-notmuch: " Jan Malakhovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451228057-12960-3-git-send-email-oxij@oxij.org \
    --to=oxij@oxij.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).