summaryrefslogtreecommitdiffhomepage
path: root/custom/jao-custom-gnus.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-09-22 23:10:07 +0100
committerjao <jao@gnu.org>2025-09-22 23:10:07 +0100
commit9fd3c77c4e8fed16d4f693ecb3c3d8527caad19f (patch)
tree93316f676e375fcd4ce0db0e737d01ede4271e8c /custom/jao-custom-gnus.el
parentb1434dd1cbbf923385e4eef6ed288225e5280037 (diff)
downloadelibs-9fd3c77c4e8fed16d4f693ecb3c3d8527caad19f.tar.gz
elibs-9fd3c77c4e8fed16d4f693ecb3c3d8527caad19f.tar.bz2
gnus: another unsuccessful read-only-local-mail demon
Diffstat (limited to 'custom/jao-custom-gnus.el')
-rw-r--r--custom/jao-custom-gnus.el38
1 files changed, 13 insertions, 25 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el
index cffedb6..d53adb7 100644
--- a/custom/jao-custom-gnus.el
+++ b/custom/jao-custom-gnus.el
@@ -182,11 +182,12 @@
nnml-get-new-mail t
nnml-directory message-directory)
+(defvar jao-local-mail-sources
+ (mapcar (lambda (f) `(maildir :path ,(expand-file-name f jao-maildir)))
+ '("local/" "feeds/")))
+
(setq mail-sources
(let* ((pwd (auth-source-pick-first-password :host "proton-bridge"))
- (mds (mapcar (lambda (f)
- `(maildir :path ,(expand-file-name f jao-maildir)))
- '("local/" "feeds/")))
(ims (mapcar (lambda (b)
`(imap :server "127.0.0.1" :port 1143
:user "jaor@pm.me" :password ,pwd
@@ -195,7 +196,7 @@
:mailbox ,(concat "Labels/#" b)))
'("inbox" "drivel" "hacking" "bills"
"bigml" "prog" "words"))))
- (append mds ims)))
+ (append jao-local-mail-sources ims)))
(when jao-gnus-use-nnml
(add-to-list
@@ -611,34 +612,21 @@
(require 'gnus-demon)
-(defvar jao-gnus-scan-level 2)
-
-(defun jao-gnus--scan-level (level)
- (let ((win (current-window-configuration)))
- (unwind-protect
- (save-window-excursion
- (when (gnus-alive-p)
- (with-current-buffer gnus-group-buffer
- (gnus-group-get-new-news level))))
- (set-window-configuration win))))
-
(defun jao-gnus--scan ()
(let ((inhibit-message t))
- (jao-gnus--scan-level jao-gnus-scan-level)
+ (gnus-demon-scan-news)
(jao-gnus--notify)))
-(defun jao-gnus-demon-scan-level (level)
- (let ((win (current-window-configuration)))
- (unwind-protect
- (save-window-excursion
- (when (gnus-alive-p)
- (with-current-buffer gnus-group-buffer
- (gnus-group-get-new-news level t))))
- (set-window-configuration win))))
+(defun jao-gnus--scan-local-mail ()
+ (let ((inhibit-message t))
+ (let ((mail-sources jao-local-mail-sources))
+ (gnus-demon-scan-mail))
+ (jao-gnus--notify)))
(defun jao-gnus-add-demon ()
(interactive)
- (gnus-demon-add-handler 'jao-gnus--scan 5 1))
+ (gnus-demon-add-handler
+ (jao-d-l 'jao-gnus--scan-local-mail 'jao-gnus--scan) 5 1))
(jao-gnus-add-demon)
;; (gnus-demon-remove-handler 'jao-gnus--scan)