]> git.eshelyaron.com Git - emacs.git/commitdiff
Adjust location of Gnus group split setup process
authorEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 27 Jul 2019 16:11:04 +0000 (09:11 -0700)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 27 Jul 2019 16:11:04 +0000 (09:11 -0700)
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.

doc/misc/gnus.texi
lisp/gnus/gnus-mlspl.el

index cc6873cfcb44233c888dad51989046298ad86fb2..3968fa583776cf74dab74941ccd2c596ef5aca72 100644 (file)
@@ -15720,7 +15720,7 @@ you.  For example, add to your @file{~/.gnus.el}:
 @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
index e9c0de968b3a14274975fbbbcb5ca4da06df87d3..74e132b7a48e2e64716cb3eb9e983e86a9001b4a 100644 (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)