[Gnus] Move Gnus’ demon configuration to db-mail and init.el
This commit is contained in:
parent
784f5ce1fd
commit
26b0234b56
20
gnus.el
20
gnus.el
@ -63,26 +63,6 @@
|
||||
(nnimap-inbox "INBOX")))))
|
||||
db/mail-accounts))))
|
||||
|
||||
|
||||
;;; 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)
|
||||
(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 'db/gnus-demon-scan-news-on-level-2 5 5)
|
||||
|
||||
|
||||
;;; Mail Formatting
|
||||
|
||||
|
||||
6
init.el
6
init.el
@ -1205,7 +1205,8 @@
|
||||
db/gnus-save-newsrc-with-whitespace-1
|
||||
db/gnus-summary-open-Link
|
||||
db/gnus-html-mime-part-to-org
|
||||
db/set-smtp-server-from-header))
|
||||
db/set-smtp-server-from-header
|
||||
db/gnus-demon-scan-news-on-level-2))
|
||||
|
||||
(use-package bbdb
|
||||
:commands (bbdb-search-name bbab-initialize bbdb-mua-auto-update-init bbdb-save)
|
||||
@ -1487,6 +1488,9 @@
|
||||
(add-hook 'gnus-save-quick-newsrc-hook
|
||||
#'db/gnus-save-newsrc-with-whitespace-1)
|
||||
|
||||
;; Automatically scan for new news
|
||||
(gnus-demon-add-handler 'db/gnus-demon-scan-news-on-level-2 5 5)
|
||||
|
||||
;; Visit group under point and immediately close it; this updates
|
||||
;; gnus’ registry as a side-effect
|
||||
(bind-key "v u"
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
(require 'mail-extr)
|
||||
(require 'epg)
|
||||
(require 'mml-sec)
|
||||
(require 'gnus)
|
||||
|
||||
;; XXX: This needs some functionality for local accounts
|
||||
(defcustom db/mail-accounts nil
|
||||
@ -154,5 +155,21 @@ entry of the current mail."
|
||||
(message "Sending with default account settings")
|
||||
(apply orig-fun args)))))
|
||||
|
||||
(defun db/gnus-demon-scan-news-on-level-2 ()
|
||||
"Scan for news in Gnus on level 2."
|
||||
;; from https://www.emacswiki.org/emacs/GnusDemon
|
||||
(require 'gnus-start) ; load global variables
|
||||
(let ((win (current-window-configuration))
|
||||
(gnus-read-active-file 'some)
|
||||
(gnus-check-new-newsgroups nil)
|
||||
(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)))))
|
||||
|
||||
(provide 'db-mail)
|
||||
;;; db-mail ends here
|
||||
|
||||
Loading…
Reference in New Issue
Block a user