From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84023 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] Use `gnus-parameters' in `gnus-group-split-fancy' Date: Thu, 02 Jan 2014 23:43:08 +0100 Message-ID: <878uuyt37n.fsf@hati.baby-gnu.org> References: <87fvpvbj8k.fsf@hati.baby-gnu.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 1388702664 22212 80.91.229.3 (2 Jan 2014 22:44:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Jan 2014 22:44:24 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32275@lists.math.uh.edu Thu Jan 02 23:44:29 2014 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 1Vyr05-0003qU-AI for ding-account@gmane.org; Thu, 02 Jan 2014 23:44:25 +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 1Vyqz0-0006le-76; Thu, 02 Jan 2014 16:43:18 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Vyqyw-0006lQ-PT for ding@lists.math.uh.edu; Thu, 02 Jan 2014 16:43:14 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1Vyqyv-0007QR-0N for ding@lists.math.uh.edu; Thu, 02 Jan 2014 16:43:14 -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 1Vyqys-0008Cs-SI for ding@gnus.org; Thu, 02 Jan 2014 23:43:11 +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 1Vyqyq-0006jz-SM for ding@gnus.org; Thu, 02 Jan 2014 23:43:08 +0100 Organisation: Dark Church of Emacs Mail-Followup-To: ding@gnus.org In-Reply-To: <87fvpvbj8k.fsf@hati.baby-gnu.org> (Daniel Dehennin's message of "Sat, 14 Dec 2013 15:27:39 +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:84023 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, This version of the patch[1] fixes two problems of the previous one: 1. some SPLIT where duplicated because the group name was present in =E2=80=9Cgnus-newsrc-alist=E2=80=9D and in =E2=80=9Cgnus-parameters=E2= =80=9D 2. using only groups from =E2=80=9Cgnus-newsrc-alist=E2=80=9D avoid creatin= g new ones automatically when splitting, now, a user just need to: 1. add a new entry to =E2=80=9Cgnus-parameters=E2=80=9D 2. update =E2=80=9Cnnmail-split-fancy=E2=80=9D with =E2=80=9Cgnus-group-= split-update=E2=80=9D 3. subscribe to the new mailing list 4. the splitting will create the new group automatically when the first mail arrives Regards. The following changes since commit b4bc300f0dcddc2b17bb50a3501ed6e6db1ef12c: Update copyright year to 2014 (2014-01-01 10:39:44 +0000) are available in the git repository at: git://git.baby-gnu.net/gnus.git tags/feature/use-gnus-parameters-in-gnus-= group-split-fancy for you to fetch changes up to b612682b8df60b5b4a2a854639f1cfb6d6fb28a3: Use `gnus-parameters' in `gnus-group-split-fancy' (2014-01-02 23:25:17 +0= 100) =2D--------------------------------------------------------------- Group splitting does not use =E2=80=9Cgnus-parameters=E2=80=9D This version of the patch build the list of all unique group names gathered from =E2=80=9Cgnus-newsrc-alist=E2=80=9D and =E2=80=9Cgnus-paramet= ers=E2=80=9D and then use =E2=80=9Cgnus-group-find-parameter=E2=80=9D to get each group parameters. Using only =E2=80=9Cgnus-newsrc-alist=E2=80=9D avoids the automatic creatio= n of new group during splitting when only =E2=80=9Cgnus-parameters=E2=80=9D is confi= gured. Filter the groups during the build of group names, this avoid calculation if user pass a list of group names. =2D--------------------------------------------------------------- Daniel Dehennin (1): Use `gnus-parameters' in `gnus-group-split-fancy' lisp/gnus-mlspl.el | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/lisp/gnus-mlspl.el b/lisp/gnus-mlspl.el index 8dec6f2..2d86d0b 100644 =2D-- a/lisp/gnus-mlspl.el +++ b/lisp/gnus-mlspl.el @@ -146,20 +146,27 @@ Calling (gnus-group-split-fancy nil nil \"mail.others= \") returns: (any \"\\\\(foo@nowhere\\\\.gov\\\\|foo@localhost\\\\|foo-redist@hom= e\\\\)\" - \"bugs-foo\" - \"rambling-foo\" \"mail.foo\")) \"mail.others\")" =2D (let* ((newsrc (cdr gnus-newsrc-alist)) =2D split) =2D (dolist (info newsrc) =2D (let ((group (gnus-info-group info)) =2D (params (gnus-info-params info))) =2D ;; For all GROUPs that match the specified GROUPS =2D (when (or (not groups) =2D (and (listp groups) =2D (memq group groups)) =2D (and (stringp groups) =2D (string-match groups group))) =2D (let ((split-spec (assoc 'split-spec params)) group-clean) =2D ;; Remove backend from group name =2D (setq group-clean (string-match ":" group)) + (let ((group-names (if (and (listp groups) + (not (null groups))) + groups + (delete-dups + (delq nil + (mapcar + (lambda (info) + (let ((group (gnus-info-group info))) + (if (or (not groups) + (and (stringp groups) + (string-match groups group))) + group))) + (append gnus-newsrc-alist gnus-parameters)))))) + split) + (dolist (group group-names) + (let ((params (gnus-group-find-parameter group))) + ;; Skip groups without param (or nonexistent) + (when (not (null params)) + (let ((split-spec (assoc 'split-spec params)) group-clean) + ;; Remove backend from group name + (setq group-clean (string-match ":" group)) (setq group-clean (if group-clean (substring group (1+ group-clean)) Footnotes:=20 [1] http://git.baby-gnu.net/gitweb/gitweb.cgi?p=3Dgnus.git;a=3Dtag;h=3Dref= s/tags/feature/use-gnus-parameters-in-gnus-group-split-fancy =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) iF4EAREKAAYFAlLF63wACgkQFrLRMcygGku61AD/XtgUfCAyG+nkUxw70NMv+W2I dDedLrzkjGTnjz4ER1MA/0TfZYpkxAEIQPaC8qbZ/kWzR9kEC1a7Ahp+YQSL7kAv =rTUA -----END PGP SIGNATURE----- --=-=-=--