summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-10-29 00:41:30 +0000
committerjao <jao@gnu.org>2024-10-29 00:41:30 +0000
commita7c09173974e4f4a1bb94c2eae4de0b47e5eb966 (patch)
tree534955462b23058d2663c1344b3b8261a27617fe
parent6675c7b46425bdd00a07bf3aaaffc8680b1aef42 (diff)
downloadelibs-a7c09173974e4f4a1bb94c2eae4de0b47e5eb966.tar.gz
elibs-a7c09173974e4f4a1bb94c2eae4de0b47e5eb966.tar.bz2
gnus/notmuch interaction recovered
-rw-r--r--custom/jao-custom-gnus.el12
-rw-r--r--lib/net/jao-notmuch-gnus.el (renamed from attic/elisp/jao-notmuch-gnus.el)8
2 files changed, 15 insertions, 5 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index 440a44f..70823ef 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -614,6 +614,7 @@
(jao-gnus--notify)))
(defun jao-gnus-add-demon ()
+ (interactive)
(gnus-demon-add-handler 'jao-gnus--scan 5 1))
(jao-gnus-add-demon)
@@ -637,7 +638,7 @@
("nnml:jao\\.\\(inbox\\|trove\\)" "I" jao-themes-f01)
("nnml:bigml\\.[^aibs]" "W" jao-themes-dimm)
("nnml:jao.hacking" "H" jao-themes-dimm)
- ("nnml:jao.write" "W" jao-themes-error)
+ ("nnml:jao.write" "W" jao-themes-warning)
("nnml:jao.[^isthw]" "J" jao-themes-dimm)
(,(format "^nnml:%s" (regexp-opt feeds)) "F" jao-themes-dimm)
("feeds\\.e" "E" jao-themes-dimm)
@@ -762,6 +763,15 @@
(with-eval-after-load "consult-recoll"
(add-to-list 'consult-recoll-open-fns
'("message/rfc822" . jao-gnus-goto-file))))
+;;;; notmuch
+(use-package jao-notmuch-gnus
+ :demand t)
+
+(jao-load-path "consult-notmuch")
+
+(use-package consult-notmuch
+ :bind (:map gnus-group-mode-map ("S" . #'jao-gnus-consult-notmuch)))
+
;;; keyboard shortcuts
(define-key gnus-article-mode-map "i" 'jao-gnus-show-images)
(define-key gnus-summary-mode-map "i" 'jao-gnus-show-images)
diff --git a/attic/elisp/jao-notmuch-gnus.el b/lib/net/jao-notmuch-gnus.el
index 1576964..5eedd97 100644
--- a/attic/elisp/jao-notmuch-gnus.el
+++ b/lib/net/jao-notmuch-gnus.el
@@ -1,6 +1,6 @@
;;; jao-notmuch-gnus.el --- notmuch-gnus interoperability -*- lexical-binding: t; -*-
-;; Copyright (C) 2022 jao
+;; Copyright (C) 2022, 2024 jao
;; Author: jao <mail@jao.io>
;; Keywords: mail
@@ -113,10 +113,10 @@
(defvar jao-notmuch-gnus-server "nnml"
"Name of the target Gnus server, e.g. nnml+mail.")
-(defvar jao-notmuch-gnus-mail-directory (expand-file-name "~/.emacs.d/gnus/Mail")
+(defvar jao-notmuch-gnus-mail-directory (expand-file-name "~/var/mail/gnus")
"Directory where Gnus stores its mail.")
-(defvar jao-notmuch-gnus-leafnode-directory (expand-file-name "~/var/news")
+(defvar jao-notmuch-gnus-leafnode-directory (expand-file-name "~/var/mail/news")
"Directory where leafnode stores its messages as seen by notmuch.")
(defun jao-notmuch-gnus-file-to-group (file &optional maildir newsdir)
@@ -212,7 +212,7 @@ Example:
(defun jao-notmuch-gnus--open-candidate (candidate)
"Open a notmuch-search completion candidate email in Gnus."
(message "candidate: %S" candidate)
- (jao-notmuch-gnus-goto-message (consult-notmuch--thread-id candidate)))
+ (jao-notmuch-gnus-goto-message (consult-notmuch--candidate-id candidate)))
(defun jao-gnus-consult-notmuch ()
"Run a consult-notmuch query that opens candidates in Gnus."