Function: gnus-group-split-setup

gnus-group-split-setup is an autoloaded, interactive and byte-compiled function defined in gnus-mlspl.el.gz.

Signature

(gnus-group-split-setup &optional AUTO-UPDATE CATCH-ALL)

Documentation

Set up the split for nnmail-split-fancy(var)/nnmail-split-fancy(fun).

Sets things up so that nnmail-split-fancy is used for mail splitting, and defines the variable nnmail-split-fancy according with 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 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 by gnus-group-split-update, and only when its CATCH-ALL argument is nil. This argument may contain any fancy split, that will be added as the last split in a | split produced by gnus-group-split-fancy, unless overridden by any group marked as a catch-all group. Typical uses are as simple as the name of a default mail group, but more elaborate fancy splits may also be useful to split mail that doesn't match any of the group-specified splitting rules. See gnus-group-split-fancy for details.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-mlspl.el.gz
;;;###autoload
(defun gnus-group-split-setup (&optional auto-update catch-all)
  "Set up the split for `nnmail-split-fancy'.
Sets things up so that nnmail-split-fancy is used for mail
splitting, and defines the variable nnmail-split-fancy according with
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
`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
by gnus-group-split-update, and only when its CATCH-ALL argument is
nil.  This argument may contain any fancy split, that will be added as
the last split in a `|' split produced by `gnus-group-split-fancy',
unless overridden by any group marked as a catch-all group.  Typical
uses are as simple as the name of a default mail group, but more
elaborate fancy splits may also be useful to split mail that doesn't
match any of the group-specified splitting rules.  See
`gnus-group-split-fancy' for details."
  (interactive "P")
  (setq nnmail-split-methods 'nnmail-split-fancy)
  (when catch-all
    (setq gnus-group-split-default-catch-all-group catch-all))
  (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))