From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83965 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Use `gnus-parameters' in `gnus-group-split-fancy' Date: Sat, 14 Dec 2013 15:27:39 +0100 Message-ID: <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 1387031337 3018 80.91.229.3 (14 Dec 2013 14:28:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Dec 2013 14:28:57 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32220@lists.math.uh.edu Sat Dec 14 15:29:03 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 1VrqDH-0007Gq-5L for ding-account@gmane.org; Sat, 14 Dec 2013 15:29:03 +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 1VrqC7-0005f6-DW; Sat, 14 Dec 2013 08:27:51 -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 1VrqC5-0005es-2W for ding@lists.math.uh.edu; Sat, 14 Dec 2013 08:27:49 -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 1VrqBz-0008Sg-AK for ding@lists.math.uh.edu; Sat, 14 Dec 2013 08:27:48 -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 1VrqBx-0003UM-GD for ding@gnus.org; Sat, 14 Dec 2013 15:27:41 +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 1VrqBw-0007xJ-51 for ding@gnus.org; Sat, 14 Dec 2013 15:27:40 +0100 Organisation: Dark Church of Emacs 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:83965 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I use a little patch[1] since years to split groups not only on group parameters from =E2=80=9Cnewsrc=E2=80=9D but from =E2=80=9Cgnus-parameters= =E2=80=9D too. I found the later easier to manage. Following is my pull request, if you want it. Regards. The following changes since commit 23c6fe6e28b8b6f356bae60e2fc773c41cd8b540: gnus-msg.el (gnus-setup-message): Fix last commit (2013-12-09 00:35:04 +0= 000) 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 a0a3183b02ae84a53e266522fbc74d548a7cba00: Use `gnus-parameters' in `gnus-group-split-fancy' (2013-12-14 15:10:06 +0= 100) =2D--------------------------------------------------------------- Group splitting does not use `gnus-parameters' I found `gnus-parameters' easier to manage than `newsrc': =2D human readable file =2D file is versionned This patch add the `gnus-parameters' to `newsrc' structure before building split. =2D--------------------------------------------------------------- Daniel Dehennin (1): Use `gnus-parameters' in `gnus-group-split-fancy' lisp/gnus-mlspl.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lisp/gnus-mlspl.el b/lisp/gnus-mlspl.el index 3947c67..0690a12 100644 =2D-- a/lisp/gnus-mlspl.el +++ b/lisp/gnus-mlspl.el @@ -94,10 +94,24 @@ See `gnus-group-split-fancy' for more information. (gnus-group-split-update) (nnmail-split-fancy))) =20 +(defun gnus-group-split-prepare-parameters (&optional parameters) + "Convert PARAMETERS alist or `gnus-parameters' to a newsrc +structure usable by `gnus-group-split-fancy'" + (let ((group-params (if parameters + parameters + gnus-parameters)) + newsrc-alist) + (dolist (param-assoc group-params newsrc-alist) + (let ((group (car param-assoc)) + (param (cdr param-assoc))) + (setq newsrc-alist + (append newsrc-alist (list (list group nil nil nil nil param)))))))) + ;;;###autoload (defun gnus-group-split-fancy (&optional groups no-crosspost catch-all) =2D "Uses information from group parameters in order to split mail. + "Uses information from group parameters and `gnus-parameters' +in order to split mail. It can be embedded into `nnmail-split-fancy' lists with the SPLIT =20 \(: gnus-group-split-fancy GROUPS NO-CROSSPOST CATCH-ALL\) @@ -146,7 +160,7 @@ 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)) + (let* ((newsrc (append (cdr gnus-newsrc-alist) (gnus-group-split-prepare= -parameters))) split) (dolist (info newsrc) (let ((group (gnus-info-group info)) 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) iF4EAREKAAYFAlKsatwACgkQFrLRMcygGku8FgD6ApyBxUwHRPp1YmU3iPdI6EIJ rvVR7syKVoAlDLu6MYkA/iZ0XKy8K5b6StcP9PwNprtbnv/DL1W5mISFXB4s9j+L =GJlx -----END PGP SIGNATURE----- --=-=-=--