From 2d3c3feb69994c08cea262ef958b2b63fc418c87 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 29 Apr 2022 02:51:02 +0100 Subject: recoll: display message/rfc822 via notmuch --- completion.org | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'completion.org') diff --git a/completion.org b/completion.org index 3572789..9616da6 100644 --- a/completion.org +++ b/completion.org @@ -569,7 +569,7 @@ (defun jao-recoll-format (title url mtype) (let* ((u (replace-regexp-in-string "/home/jao/" "" url)) (u (replace-regexp-in-string - "\\(doc\\|org/doc\\|.emacs.d/gnus/Mail\\)/" "" u))) + "\\(doc\\|org/doc\\|.emacs.d/gnus/Mail\\|var/mail\\)/" "" u))) (format "%s (%s, %s)" title (propertize u 'face 'jao-themes-f00) @@ -600,10 +600,19 @@ (interactive) (jao-recoll (format "dir:%s " jao-org-notes-dir))) + (defun jao-recoll-open-with-notmuch (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))))) + (use-package consult-recoll :init (setq consult-recoll-open-fns '(("application/pdf" . jao-open-doc) - ("message/rfc822" . jao-org-links-open-mail) + ("message/rfc822" . jao-recoll-open-with-notmuch) ("text/html" . jao-recoll-open-html)) consult-recoll-search-flags nil consult-recoll-format-candidate #'jao-recoll-format) -- cgit v1.2.3