summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-notmuch.el16
1 files changed, 16 insertions, 0 deletions
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"