diff options
Diffstat (limited to 'custom/jao-custom-gnus.el')
-rw-r--r-- | custom/jao-custom-gnus.el | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index 97201ad..cffedb6 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -611,22 +611,42 @@ (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)) - (gnus-demon-scan-news) + (jao-gnus--scan-level jao-gnus-scan-level) (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-add-demon () (interactive) (gnus-demon-add-handler 'jao-gnus--scan 5 1)) -(jao-when-linux - (jao-gnus-add-demon) - ;; (gnus-demon-remove-handler 'jao-gnus--scan) - (gnus-demon-init) - ;; this is, in theory, not needed; but at some point in the way to emacs - ;; version 31 this idle timers have ceased to work after a sleep/awake cycle - (jao-when-linux (add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon))) +(jao-gnus-add-demon) +;; (gnus-demon-remove-handler 'jao-gnus--scan) +(gnus-demon-init) + +;; this is, in theory, not needed; but at some point in the way to emacs +;; version 31 this idle timers have ceased to work after a sleep/awake cycle +(jao-when-linux (add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon)) ;;; add-ons ;;;; notifications |