+2000-02-02 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+ * gnus-mlspl.el: Documentation tweaks.
+
2000-11-06 22:06:44 ShengHuo ZHU <zsh@cs.rochester.edu>
* mm-decode.el (mm-possibly-verify-or-decrypt): Fix.
(require 'nnmail)
(defvar gnus-group-split-updated-hook nil
- "Hook called just after nnmail-split-fancy is updated by gnus-group-split-update.")
+ "Hook called just after nnmail-split-fancy is updated by
+gnus-group-split-update.")
(defvar gnus-group-split-default-catch-all-group "mail.misc"
- "Group used by gnus-group-split and gnus-group-split-update as default catch-all group.")
+ "Group name (or arbitrary fancy split) with default splitting rules.
+Used by gnus-group-split and gnus-group-split-update as a fallback
+split, in case none of the group-based splits matches.")
;;;###autoload
(defun gnus-group-split-setup (&optional auto-update catch-all)
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."
+nnmail-pre-get-new-mail-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
;;;###autoload
(defun gnus-group-split-update (&optional catch-all)
- "Computes nnmail-split-fancy from group params.
-It does this by calling \(gnus-group-split-fancy nil CROSSPOST DEFAULTGROUP)."
+ "Computes nnmail-split-fancy from group params and CATCH-ALL, by
+calling (gnus-group-split-fancy nil nil CATCH-ALL).
+
+If CATCH-ALL is nil, gnus-group-split-default-catch-all-group is used
+instead. This variable is set by gnus-group-split-setup."
(interactive)
(setq nnmail-split-fancy
(gnus-group-split-fancy
"Uses information from group parameters in order to split mail.
See gnus-group-split-fancy for more information.
-If no group is defined as catch-all, the value of
-gnus-group-split-default-catch-all-group is used.
-
gnus-group-split is a valid value for nnmail-split-methods."
(let (nnmail-split-fancy)
- (gnus-group-split-update
- gnus-group-split-default-catch-all-group)
+ (gnus-group-split-update)
(nnmail-split-fancy)))
;;;###autoload
otherwise, a | split, that does not allow crossposting, will be
returned.
-if CATCH-ALL is not nil, and there is no selected group whose
-SPLIT-REGEXP matches the empty string, nor is there a selected group
-whose SPLIT-SPEC is 'catch-all, this group name will be appended to
-the returned SPLIT list, as the last element in a '| SPLIT.
-
For each selected group, a SPLIT is composed like this: if SPLIT-SPEC
is specified, this split is returned as-is (unless it is nil: in this
case, the group is ignored). Otherwise, if TO-ADDRESS, TO-LIST and/or
matches this regexp too, and if SPLIT-EXCLUDE is specified, RESTRICT
clauses will be generated.
+If CATCH-ALL is nil, no catch-all handling is performed, regardless of
+catch-all marks in group parameters. Otherwise, if there is no
+selected group whose SPLIT-REGEXP matches the empty string, nor is
+there a selected group whose SPLIT-SPEC is 'catch-all, this fancy
+split (say, a group name) will be appended to the returned SPLIT list,
+as the last element of a '| SPLIT.
+
For example, given the following group parameters:
nnml:mail.bar:
\e$B$O\e(B @code{gnus-group-split-default-catch-all-group} \e$B$G;XDj$5$l$F$$$k%0%k!<\e(B
\e$B%W$KJ]B8$5$l$^$9!#\e(B@var{split-spec} \e$B$,\e(B @code{catch-all} \e$B$K@_Dj$5$l$F$$$k\e(B
\e$B%0%k!<%W$,$"$k>l9g$O!"$=$N%0%k!<%W$,A4$F$rJa3M$9$k%0%k!<%W$H$7$F;HMQ$5$l\e(B
-\e$B$^$9!#$3$N>l9g$O!"\e(B@code{|} \e$BFC5iJ,3d$,\e(B @code{&} \e$BJ,3d$HA4$F$rJa3M$9$k%0%k!<\e(B
-\e$B%W$rJDJq$9$k$h$&$K!"Aj8_Ej9F$O9T$o$l$J$$$3$H$KCm0U$7$F$/$@$5$$!#\e(B
+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4Ja3MJ,3d$O9T$o$l$^$;$s!#$=$&$G$J\e(B
-\e$B$$>l9g!"%0%k!<%W$K\e(B @var{split-spec} \e$B$,\e(B @code{catch-all} \e$B$K@_Dj$5$l$F$$$k\e(B
-\e$B$b$N$,$"$k$H!"$3$N%0%k!<%W$,\e(B @var{catch-all} \e$B0z?t$r>e=q$-$7$^$9!#\e(B
+@var{catch-all} \e$B$O\e(B @var{gnus-group-split-default-catch-all-group} \e$B$N$h$&\e(B
+\e$B$K!":G8e$N<jCJ$H$7$F;H$o$l$kFC5iJ,3d$G$9!#\e(B@var{catch-all} \e$B$,\e(B @code{nil} \e$B$G\e(B
+\e$B$"$k$+!"\e(B@var{split-regexp} \e$B$,$I$l$+$NA*Br$5$l$?%0%k!<%W6uJ8;zNs$K9gCW$9\e(B
+\e$B$k$H!"A4Ja3MJ,3d$O9T$o$l$^$;$s!#$=$&$G$J$$>l9g!"%0%k!<%W\e(B
+\e$B$K\e(B @var{split-spec} \e$B$,\e(B @code{catch-all} \e$B$K@_Dj$5$l$F$$$k$b$N$,$"$k$H!"$3\e(B
+\e$B$N%0%k!<%W$,\e(B @var{catch-all} \e$B0z?t$r>e=q$-$7$^$9!#\e(B
@findex gnus-group-split-setup
\e$BIT1?$J$3$H$K!"A4$F$N%0%k%W$H%Q%i%a!<%?$rAv::$9$k$3$H$OHs>o$KCY$$$G$9!#FC\e(B
\e$B$KA4$F$N%a%C%;!<%8$KBP$7$F$J$5$l$k$3$H$r9M$($k$H!#$1$l$I$b!"@dK>$7$J$$\e(B
\e$B$G\e(B! \e$B4X?t\e(B @code{gnus-group-split-setup} \e$B$,\e(B @code{gnus-group-split} \e$B$r$h$j\e(B
-\e$B$:$C$H8zN(E*$JJ}K!$GA*Br$9$k$h$&$K;H$&$3$H$,$G$-$^$9!#$=$l\e(B
+\e$B$:$C$H8zN(E*$JJ}K!$G;H$&$3$H$,$G$-$^$9!#$=$l\e(B
\e$B$O\e(B @code{nnmail-split-methods} \e$B$r\e(B @code{nnmail-split-fancy} \e$B$K@_Dj$7!"\e(B
@code{nnmail-split-fancy} \e$B$r\e(B @code{gnus-group-split-fancy} \e$B$G@8@.$5$l$?\e(B
\e$BJ,3d$K@_Dj$7$^$9!#$3$&$7$F$I$s$J$KJ,3d$9$k%a%C%;!<%8$,$?$/$5$s$"$C$F$b!"\e(B
@var{auto-update} \e$B$,\e(B @code{nil} \e$B$GL5$$$H!"\e(B
@code{gnus-group-split-update} \e$B$,\e(B @code{nnmail-pre-get-new-mail-hook} \e$B$K\e(B
\e$BDI2C$5$l!"FsEY$H\e(B @code{nnmail-split-fancy} \e$B$N99?7$r?4G[$9$kI,MW$O$"$j$^\e(B
-\e$B$;$s!#\e(B@var{catch-all} \e$B$r>JN,$7$J$$>l9g$O\e(B (\e$B$=$l$O%*%W%7%g%s$G\e(B
-\e$B$9\e(B) @code{gnus-group-split-default-catch-all-group} \e$B$O$=$NCM$K@_Dj$5$l$^\e(B
-\e$B$9!#\e(B
+\e$B$;$s!#\e(B@var{catch-all} \e$B$r>JN,$7$J$$>l9g$O\e(B (\e$B$=$l$O%*%W%7%g%s$G\e(B nil \e$B$HF1$8\e(B)\e$B!"\e(B
+@code{gnus-group-split-default-catch-all-group} \e$B$O$=$NCM$K@_Dj$5$l$^$9!#\e(B
@vindex gnus-group-split-updated-hook
@code{nnmail-split-fancy} \e$B$,\e(B @code{gnus-group-split-update} \e$B$G@_Dj$5$l$?\e(B
group. If a message doesn't match any split, it will be stored in the
group named in @code{gnus-group-split-default-catch-all-group}, unless
some group has @var{split-spec} set to @code{catch-all}, in which case
-that group is used as the catch-all group. Note that, in this case,
-there's no cross-posting, as a @code{|} fancy split encloses the
-@code{&} split and the catch-all group.
+that group is used as the catch-all group. Even though this variable is
+often used just to name a group, it may also be set to an arbitrarily
+complex fancy split (after all, a group name is a fancy split), and this
+may be useful to split mail that doesn't go to any mailing list to
+personal mail folders. Note that this fancy split is added as the last
+element of a @code{|} split list that also contains a @code{&} split
+with the rules extracted from group parameters.
It's time for an example. Assume the following group parameters have
been defined:
@var{groups} may be a regular expression or a list of group names whose
parameters will be scanned to generate the output split.
@var{no-crosspost} can be used to disable cross-posting; in this case, a
-single @code{|} split will be output. @var{catch-all} may be the name
-of a group to be used as the default catch-all group. If
-@var{catch-all} is @code{nil}, or if @var{split-regexp} matches the
+single @code{|} split will be output. @var{catch-all} is the fallback
+fancy split, used like @var{gnus-group-split-default-catch-all-group}.
+If @var{catch-all} is @code{nil}, or if @var{split-regexp} matches the
empty string in any selected group, no catch-all split will be issued.
Otherwise, if some group has @var{split-spec} set to @code{catch-all},
this group will override the value of the @var{catch-all} argument.
Unfortunately, scanning all groups and their parameters can be quite
slow, especially considering that it has to be done for every message.
But don't despair! The function @code{gnus-group-split-setup} can be
-used to select @code{gnus-group-split} in a much more efficient way. It
+used to enable @code{gnus-group-split} in a much more efficient way. It
sets @code{nnmail-split-methods} to @code{nnmail-split-fancy} and sets
@code{nnmail-split-fancy} to the split produced by
@code{gnus-group-split-fancy}. Thus, the group parameters are only
scanned once, no matter how many messages are split.
@findex gnus-group-split-update
-However, if you change group parameters, you have to update
+However, if you change group parameters, you'd have to update
@code{nnmail-split-fancy} manually. You can do it by running
@code{gnus-group-split-update}. If you'd rather have it updated
automatically, just tell @code{gnus-group-split-setup} to do it for
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
have to worry about updating @code{nnmail-split-fancy} again. If you
-don't omit @var{catch-all} (it's optional),
+don't omit @var{catch-all} (it's optional; same as nil),
@code{gnus-group-split-default-catch-all-group} will be set to its
value.
should go for both Gnus' own folders and the folders Gnus reads from
(e.g. /var/spool/mail/${USER}). All backends this makes sense for.
+ [John Wiegley's article <200011030445.VAA08277@localhost.dynodns.net>,
+ posted on gnu.emacs.gnus does this.
+ Also, gnus-article-encrypt `K E' encrypts the article body.]
+
* The stuff on "Newest Features" in the manual should be implemented
and the node updated (it maybe is?).