[notmuch] [PATCH] New function notmuch-show-kill-ring-save-message-id.

Jed Brown jed at 59A2.org
Tue Nov 24 12:22:11 PST 2009

Puts current message ID in the kill ring.  This is useful any time you
want to explicitly refer to the message, such as in the body of another
message, through git format-patch, or on IRC.

It is bound to "C-c i".

Corrected spelling of function name in commit message, and updated to
apply against HEAD after c1e16435cfe4471c3415d9f625f7230d59c8afb4

Signed-off-by: Jed Brown <jed at 59A2.org>
 notmuch.el |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 907df2c..e3e0e06 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -80,6 +80,7 @@
     (define-key map "?" 'describe-mode)
     (define-key map (kbd "TAB") 'notmuch-show-next-button)
     (define-key map (kbd "M-TAB") 'notmuch-show-previous-button)
+    (define-key map (kbd "C-c i") 'notmuch-show-kill-ring-save-message-id)
   "Keymap for \"notmuch show\" buffers.")
 (fset 'notmuch-show-mode-map notmuch-show-mode-map)
@@ -663,6 +664,17 @@ which this thread was originally shown."
+(defun notmuch-show-kill-ring-save-message-id ()
+  "Put the current message id in the kill ring.
+This is useful for referencing messages or running external
+  (interactive)
+  (let ((message-id (notmuch-show-get-message-id)))
+    (kill-new message-id)
+    (when (called-interactively-p 'interactive)
+      (message "Saved message ID: \"%s\"" message-id))))
 (defun notmuch-show-mode ()
   "Major mode for viewing a thread with notmuch.

More information about the notmuch mailing list