From 23a6abef8c26704cce184477d2503b3f61148d68 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 28 Mar 2017 23:51:51 -0400 Subject: Add notmuch-show-at-point command --- lisp/km-mail.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lisp') diff --git a/lisp/km-mail.el b/lisp/km-mail.el index 345d2bb..b25934c 100644 --- a/lisp/km-mail.el +++ b/lisp/km-mail.el @@ -57,6 +57,21 @@ (mark-whole-buffer) (call-interactively #'notmuch-search-archive-thread)) +;;;###autoload +(defun km/notmuch-show-at-point () + "Call `notmuch-show' with message or thread ID at point." + (interactive) + (let ((id (save-excursion + (skip-syntax-backward "^\\s-") + (and (looking-at + (rx (group (zero-or-one (or "id:" "thread:"))) + (one-or-more (any "-" "_" "." "@" "/" alnum)))) + (concat (and (string= (match-string 1) "") "id:") + (match-string-no-properties 0)))))) + (if id + (notmuch-show id) + (call-interactively #'notmuch-show)))) + ;;; Mail sync -- cgit v1.2.3