@end lisp
If @var{auto-update} is non-@code{nil}, @code{gnus-group-split-update}
-will be added to @code{nnmail-pre-get-new-mail-hook}, so you won't ever
+will be added to @code{gnus-get-top-new-news-hook}, so you won't ever
have to worry about updating @code{nnmail-split-fancy} again. If you
don't omit @var{catch-all} (it's optional, equivalent to @code{nil}),
@code{gnus-group-split-default-catch-all-group} will be set to its
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
(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)