From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84015 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Re: Group splitting on list headers Date: Fri, 27 Dec 2013 16:57:58 +0100 Message-ID: <8738leffqx.fsf_-_@hati.baby-gnu.org> References: <87iouruzzr.fsf@hati.baby-gnu.org> <87ioubhaw6.fsf@building.gnus.org> <87a9fnft1y.fsf@hati.baby-gnu.org> <87ioubeefd.fsf@building.gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1388159948 12176 80.91.229.3 (27 Dec 2013 15:59:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Dec 2013 15:59:08 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32267@lists.math.uh.edu Fri Dec 27 16:59:14 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VwZob-0007LJ-MJ for ding-account@gmane.org; Fri, 27 Dec 2013 16:59:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1VwZnb-0005IB-Kg; Fri, 27 Dec 2013 09:58:07 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1VwZna-0005Hz-6J for ding@lists.math.uh.edu; Fri, 27 Dec 2013 09:58:06 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1VwZnV-0001Al-3Y for ding@lists.math.uh.edu; Fri, 27 Dec 2013 09:58:05 -0600 Original-Received: from zion.baby-gnu.net ([82.225.168.180] helo=zion.baby-gnu.org) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1VwZnT-0006Qs-HI for ding@gnus.org; Fri, 27 Dec 2013 16:57:59 +0100 Original-Received: from hati.asgardr.info ([192.168.1.2] helo=hati.baby-gnu.org) by zion.baby-gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1VwZnS-0005Ve-IU for ding@gnus.org; Fri, 27 Dec 2013 16:57:58 +0100 Organisation: Dark Church of Emacs Mail-Followup-To: ding@gnus.org In-Reply-To: <87ioubeefd.fsf@building.gnus.org> (Lars Ingebrigtsen's message of "Thu, 26 Dec 2013 17:59:34 +0100") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84015 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Lars Ingebrigtsen writes: > Uhm... perhaps `match-list'? Shortest is best ;-) You can review my proposal patch on my gitweb[1] or with the following pull request. Tell me if something should be changed. Regards. The following changes since commit 934f25f8d8801afe315722fd0b0b4ea14bcb1534: Make split tracing work in nnimap groups, too (2013-12-26 17:39:39 +0100) are available in the git repository at: git://git.baby-gnu.net/gnus.git tags/feature/group-mail-splitting-on-list= -headers for you to fetch changes up to 2ff14c69a7ad8c4256236331fbe94ff43dd9976a: Add Group Mail Spliting on mailing-list headers (2013-12-27 16:54:15 +010= 0) =2D--------------------------------------------------------------- We define a new `list' abbreviation and `match-list' group parameter and make Group Mail Splitting generate a SPLIT using it. =2D--------------------------------------------------------------- Daniel Dehennin (1): Add Group Mail Spliting on mailing-list headers lisp/gnus-mlspl.el | 7 +++++-- lisp/nnmail.el | 1 + texi/gnus.texi | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lisp/gnus-mlspl.el b/lisp/gnus-mlspl.el index 3947c67..1997f43 100644 =2D-- a/lisp/gnus-mlspl.el +++ b/lisp/gnus-mlspl.el @@ -177,7 +177,10 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\= ") returns: (to-list (cdr (assoc 'to-list params))) (extra-aliases (cdr (assoc 'extra-aliases params))) (split-regexp (cdr (assoc 'split-regexp params))) =2D (split-exclude (cdr (assoc 'split-exclude params)))) + (split-exclude (cdr (assoc 'split-exclude params))) + (match-abbrev (if (cdr (assoc 'match-list params)) + 'list + 'any))) (when (or to-address to-list extra-aliases split-regexp) ;; regexp-quote to-address, to-list and extra-aliases ;; and add them all to split-regexp @@ -198,7 +201,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\"= ) returns: "\\)")) ;; Now create the new SPLIT (push (append =2D (list 'any split-regexp) + (list match-abbrev split-regexp) ;; Generate RESTRICTs for SPLIT-EXCLUDEs. (if (listp split-exclude) (apply #'append diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 5be449e..03d610c 100644 =2D-- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -517,6 +517,7 @@ Example: (defcustom nnmail-split-abbrev-alist '((any . "from\\|to\\|cc\\|sender\\|apparently-to\\|resent-from\\|resent= -to\\|resent-cc") (mail . "mailer-daemon\\|postmaster\\|uucp") + (list . "list-post\\|x-beenthere\\|x-loop") (to . "to\\|cc\\|apparently-to\\|resent-to\\|resent-cc") (from . "from\\|sender\\|resent-from") (nato . "to\\|cc\\|resent-to\\|resent-cc") diff --git a/texi/gnus.texi b/texi/gnus.texi index 498c8a4..03af068 100644 =2D-- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -3103,6 +3103,18 @@ interest in relation to the sieve parameter. The Sieve language is described in RFC 3028. @xref{Top, Emacs Sieve, Top, sieve, Emacs Sieve}. =20 +@item match-list +@cindex match-list +If this parameter is set to @code{t} and @code{nnmail-split-method} is +set to @code{gnus-group-split}, Gnus will lookup mail addresses +against the @code{list} split abbreviation. + +See @code{nnmail-split-abbrev-alist} for the regular expression +matching mailing-list headers. + +See @pxref{Group Mail Splitting} to automatically split on group +parameters. + @item (agent parameters) If the agent has been enabled, you can set any of its parameters to control the behavior of the agent in individual groups. See Agent @@ -15403,6 +15415,9 @@ Matches the @samp{To}, @samp{Cc}, @samp{Apparently-= To}, @samp{Resent-To} and @samp{Resent-Cc} fields. @item any Is the union of the @code{from} and @code{to} entries. +@item list +Matches the @samp{List-Post}, @samp{X-BeenThere} and @samp{X-Loop} +fields. @end table =20 @vindex nnmail-split-fancy-syntax-table Footnotes:=20 [1] http://git.baby-gnu.net/gitweb/gitweb.cgi?p=3Dgnus.git;a=3Dtag;h=3Dref= s/tags/feature/group-mail-splitting-on-list-headers =2D-=20 Daniel Dehennin R=C3=A9cup=C3=A9rer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iF4EAREKAAYFAlK9o4YACgkQFrLRMcygGks1DgD/UCdbF40+R44o3ej/38mUgy2X 3w8Qd4+s7Hz0+v4wlXEA/0qpH0tV5P+2SeckD9IbrHvuD7eRosuanOO3TFAuXh9A =6FRF -----END PGP SIGNATURE----- --=-=-=--