summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--custom/jao-custom-notmuch.el16
1 files changed, 7 insertions, 9 deletions
diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el
index de66943..bbabae2 100644
--- a/custom/jao-custom-notmuch.el
+++ b/custom/jao-custom-notmuch.el
@@ -644,14 +644,12 @@
(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)))))
+(defun jao-notmuch-open-file (fname &optional page)
+ (with-temp-buffer
+ (insert-file-contents-literally fname)
+ (goto-char (point-min))
+ (and (re-search-forward "^Message-ID: <\\([^>]+\\)>$" nil t)
+ (notmuch-show (concat "id:" (match-string 1))))))
(when jao-notmuch-enabled
(with-eval-after-load "org"
@@ -659,7 +657,7 @@
(with-eval-after-load "consult-recoll"
(add-to-list 'consult-recoll-open-fns
- ("message/rfc822" . jao-notmuch-open-file))))
+ '("message/rfc822" . jao-notmuch-open-file))))
;;; link hint
(with-eval-after-load "link-hint"