/[emacs]/emacs/lisp/gnus/gnus-mlspl.el
ViewVC logotype

Diff of /emacs/lisp/gnus/gnus-mlspl.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7.6.1 by handa, Fri Mar 12 00:02:57 2004 UTC revision 1.7.6.2 by miles, Thu Sep 9 09:36:25 2004 UTC
# Line 1  Line 1 
1  ;;; gnus-mlspl.el --- a group params-based mail splitting mechanism  ;;; gnus-mlspl.el --- a group params-based mail splitting mechanism
2  ;; Copyright (C) 1998, 1999, 2000  
3    ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
4  ;;        Free Software Foundation, Inc.  ;;        Free Software Foundation, Inc.
5    
6  ;; Author: Alexandre Oliva <oliva@lsd.ic.unicamp.br>  ;; Author: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
# Line 8  Line 9 
9  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
10    
11  ;; GNU Emacs is free software; you can redistribute it and/or modify  ;; GNU Emacs is free software; you can redistribute it and/or modify
12  ;; it under the terms of the GNU General Public License as published by  ;; it under the terms of the GNU General Public License as published
13  ;; the Free Software Foundation; either version 2, or (at your option)  ;; by the Free Software Foundation; either version 2, or (at your
14  ;; any later version.  ;; option) any later version.
15    
16  ;; GNU Emacs is distributed in the hope that it will be useful,  ;; GNU Emacs is distributed in the hope that it will be useful, but
17  ;; but WITHOUT ANY WARRANTY; without even the implied warranty of  ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18  ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  ;; GNU General Public License for more details.  ;; General Public License for more details.
20    
21  ;; You should have received a copy of the GNU General Public License  ;; You should have received a copy of the GNU General Public License
22  ;; along with GNU Emacs; see the file COPYING.  If not, write to the  ;; along with this program; see the file COPYING.  If not, write to
23  ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,  ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  ;; Boston, MA 02111-1307, USA.  ;; Boston, MA 02111-1307, USA.
25    
26  ;;; Commentary:  ;;; Commentary:
# Line 62  unless overridden by any group marked as Line 63  unless overridden by any group marked as
63  uses are as simple as the name of a default mail group, but more  uses are as simple as the name of a default mail group, but more
64  elaborate fancy splits may also be useful to split mail that doesn't  elaborate fancy splits may also be useful to split mail that doesn't
65  match any of the group-specified splitting rules.  See  match any of the group-specified splitting rules.  See
66  gnus-group-split-fancy for details."  `gnus-group-split-fancy' for details."
67    (interactive "P")    (interactive "P")
68    (setq nnmail-split-methods 'nnmail-split-fancy)    (setq nnmail-split-methods 'nnmail-split-fancy)
69    (when catch-all    (when catch-all
# Line 73  gnus-group-split-fancy for details." Line 74  gnus-group-split-fancy for details."
74    
75  ;;;###autoload  ;;;###autoload
76  (defun gnus-group-split-update (&optional catch-all)  (defun gnus-group-split-update (&optional catch-all)
77    "Computes nnmail-split-fancy from group params and CATCH-ALL, by    "Computes nnmail-split-fancy from group params and CATCH-ALL.
78  calling (gnus-group-split-fancy nil nil CATCH-ALL).  It does this by calling by calling (gnus-group-split-fancy nil
79    nil CATCH-ALL).
80    
81  If CATCH-ALL is nil, gnus-group-split-default-catch-all-group is used  If CATCH-ALL is nil, gnus-group-split-default-catch-all-group is used
82  instead.  This variable is set by gnus-group-split-setup."  instead.  This variable is set by gnus-group-split-setup."
# Line 88  instead.  This variable is set by gnus-g Line 90  instead.  This variable is set by gnus-g
90  ;;;###autoload  ;;;###autoload
91  (defun gnus-group-split ()  (defun gnus-group-split ()
92    "Uses information from group parameters in order to split mail.    "Uses information from group parameters in order to split mail.
93  See gnus-group-split-fancy for more information.  See `gnus-group-split-fancy' for more information.
94    
95  gnus-group-split is a valid value for nnmail-split-methods."  gnus-group-split is a valid value for nnmail-split-methods."
96    (let (nnmail-split-fancy)    (let (nnmail-split-fancy)
# Line 140  nnml:mail.foo: Line 142  nnml:mail.foo:
142  nnml:mail.others:  nnml:mail.others:
143  \((split-spec . catch-all))  \((split-spec . catch-all))
144    
145  Calling (gnus-group-split-fancy nil nil \"mail.misc\") returns:  Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
146    
147  \(| (& (any \"\\\\(bar@femail\\\\.com\\\\|.*@femail\\\\.com\\\\)\"  \(| (& (any \"\\\\(bar@femail\\\\.com\\\\|.*@femail\\\\.com\\\\)\"
148             \"mail.bar\")             \"mail.bar\")
149        (any \"\\\\(foo@nowhere\\\\.gov\\\\|foo@localhost\\\\|foo-redist@home\\\\)\"        (any \"\\\\(foo@nowhere\\\\.gov\\\\|foo@localhost\\\\|foo-redist@home\\\\)\"
150             - \"bugs-foo\" - \"rambling-foo\" \"mail.foo\"))             - \"bugs-foo\" - \"rambling-foo\" \"mail.foo\"))
151     \"mail.others\")"     \"mail.others\")"
152    (let* ((newsrc (cdr gnus-newsrc-alist))    (let* ((newsrc (cdr gnus-newsrc-alist))
153           split)           split)
# Line 202  Calling (gnus-group-split-fancy nil nil Line 204  Calling (gnus-group-split-fancy nil nil
204                           (list 'any split-regexp)                           (list 'any split-regexp)
205                           ;; Generate RESTRICTs for SPLIT-EXCLUDEs.                           ;; Generate RESTRICTs for SPLIT-EXCLUDEs.
206                           (if (listp split-exclude)                           (if (listp split-exclude)
207                               (let ((seq split-exclude)                               (apply #'append
208                                     res)                                      (mapcar (lambda (arg) (list '- arg))
209                                 (while seq                                              split-exclude))
                                  (push (cons '- (pop seq))  
                                        res))  
                                (apply #'nconc (nreverse res)))  
210                             (list '- split-exclude))                             (list '- split-exclude))
211                           (list group-clean))                           (list group-clean))
212                          split)                          split)

Legend:
Removed from v.1.7.6.1  
changed lines
  Added in v.1.7.6.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26