summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-04-29 02:51:02 +0100
committerjao <jao@gnu.org>2022-04-29 02:51:49 +0100
commit2d3c3feb69994c08cea262ef958b2b63fc418c87 (patch)
tree1eccb8c5097e29d5d0c3fe295bef1b62b1c4ca87
parentb387d32da3edf2e9341567590d2b8d29a79069e1 (diff)
downloadelibs-2d3c3feb69994c08cea262ef958b2b63fc418c87.tar.gz
elibs-2d3c3feb69994c08cea262ef958b2b63fc418c87.tar.bz2
recoll: display message/rfc822 via notmuch
-rw-r--r--completion.org13
-rw-r--r--lib/doc/jao-org-links.el11
2 files changed, 11 insertions, 13 deletions
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)
diff --git a/lib/doc/jao-org-links.el b/lib/doc/jao-org-links.el
index 60b0037..4704624 100644
--- a/lib/doc/jao-org-links.el
+++ b/lib/doc/jao-org-links.el
@@ -4,7 +4,6 @@
(require 'jao-org-notes)
(require 'jao-doc-view)
-(require 'jao-notmuch-gnus)
(declare pdf-info-outline "pdf-info")
@@ -55,16 +54,6 @@
f))
f))))
-(defun jao-org-links-open-mail (fname)
- (let ((group (jao-notmuch-gnus-file-to-group fname))
- (id (with-temp-buffer
- (insert-file fname)
- (goto-char (point-min))
- (message-mode)
- (not-modified)
- (message-fetch-field "Message-ID"))))
- (when (and group id) (org-gnus-follow-link group id))))
-
;;;###autoload
(defvar jao-org-links-pdf-store-fun nil)