1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Adjust location of Gnus group split setup process

Updating group splits requires the gnus-newsrc-hashtb to be
initialized. Previously this failed silently, now it errors.

* lisp/gnus/gnus-mlspl.el (gnus-group-split-setup): Don't call the
update when loading the user's init file, that's too early. Use
appropriate hooks depending on AUTO-UPDATE.
* doc/misc/gnus.texi (Group Mail Splitting): Change mention in docs.
This commit is contained in:
Eric Abrahamsen 2019-07-27 09:11:04 -07:00
parent a0389384ad
commit 883679dde8
2 changed files with 10 additions and 5 deletions

View file

@ -48,7 +48,7 @@ group parameters.
If AUTO-UPDATE is non-nil (prefix argument accepted, if called
interactively), it makes sure nnmail-split-fancy is re-computed before
getting new mail, by adding `gnus-group-split-update' to
`nnmail-pre-get-new-mail-hook'.
`gnus-get-top-new-news-hook'.
A non-nil CATCH-ALL replaces the current value of
`gnus-group-split-default-catch-all-group'. This variable is only used
@ -64,9 +64,14 @@ match any of the group-specified splitting rules. See
(setq nnmail-split-methods 'nnmail-split-fancy)
(when catch-all
(setq gnus-group-split-default-catch-all-group catch-all))
(gnus-group-split-update)
(when auto-update
(add-hook 'nnmail-pre-get-new-mail-hook 'gnus-group-split-update)))
(add-hook
(if auto-update
'gnus-get-top-new-news-hook
;; Split updating requires `gnus-newsrc-hashtb' to be
;; initialized; the read newsrc hook is the only hook that comes
;; after initialization, but before checking for new news.
'gnus-read-newsrc-el-hook)
#'gnus-group-split-update))
;;;###autoload
(defun gnus-group-split-update (&optional catch-all)