[Gnus] Trying to reenable automatic scans for new mail

This commit is contained in:
Daniel - 2017-08-01 12:16:59 +02:00
parent 217dce1e20
commit 71e97dd967
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 23 additions and 0 deletions

23
gnus
View File

@ -506,6 +506,29 @@ If found, imports the certificate via gpgsm."
(setq nntp-connection-timeout nil) (setq nntp-connection-timeout nil)
;;; Daemons
(defun db/gnus-demon-scan-news-on-level-2 ()
"Scan for news in Gnus on level 2."
;; from https://www.emacswiki.org/emacs/GnusDemon
(let ((win (current-window-configuration))
(gnus-read-active-file 'some)
(gnus-check-new-newsgroups nil)
(gnus-verbose 2)
(gnus-verbose-backends 5)
(level 2))
(while-no-input
(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)))))
(gnus-demon-add-handler 'gnus-demon-close-connections nil 10)
(gnus-demon-add-handler 'db/gnus-demon-scan-news-on-level-2 5 5)
;;; Agents ;;; Agents