From 9af5239971df315d1403733eb1e38039375ffdc9 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 30 Jun 2022 15:30:17 +0100 Subject: notmuch nits --- custom/jao-custom-notmuch.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'custom') diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 5673242..8c4146a 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -644,6 +644,22 @@ (with-eval-after-load "notmuch-hello" (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder)) +;;; recoll +(defun jao-notmuch-open-file (fname) + (let ((id (with-temp-buffer + (insert-file fname) + (goto-char (point-min)) + (when (re-search-forward "[Mm]essage-[Ii][Dd]: <]+\\)>?" + nil t) + (match-string 1))))) + (when id (notmuch-show (concat "id:" id))))) + +(with-eval-after-load "org" + (org-link-set-parameters "message" :follow #'jao-notmuch-open-file)) + +(with-eval-after-load "consult-recoll" + (add-to-list 'consult-recoll-open-fns + ("message/rfc822" . jao-notmuch-open-file))) ;;; link hint (with-eval-after-load "link-hint" -- cgit v1.2.3