From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81317 Path: news.gmane.org!not-for-mail From: Daniel Dehennin Newsgroups: gmane.emacs.gnus.general Subject: Extending 'gnus-parameters usage Date: Sat, 11 Feb 2012 17:57:16 +0100 Message-ID: <878vk9xq8j.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: dough.gmane.org 1328979456 28897 80.91.229.3 (11 Feb 2012 16:57:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Feb 2012 16:57:36 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M29597@lists.math.uh.edu Sat Feb 11 17:57:33 2012 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 1RwGGQ-00069a-Jx for ding-account@gmane.org; Sat, 11 Feb 2012 17:57:30 +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 1RwGGG-0008To-Vy; Sat, 11 Feb 2012 10:57:21 -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 1RwGGF-0008Td-O1 for ding@lists.math.uh.edu; Sat, 11 Feb 2012 10:57:19 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RwGGE-0000bQ-Sc for ding@lists.math.uh.edu; Sat, 11 Feb 2012 10:57:19 -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.72) (envelope-from ) id 1RwGGD-0000QK-51 for ding@gnus.org; Sat, 11 Feb 2012 17:57:17 +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.77) (envelope-from ) id 1RwGRB-0002q3-NH for ding@gnus.org; Sat, 11 Feb 2012 18:08:37 +0100 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) Organisation: Dark Church of Emacs X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:81317 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, For some times now I use a hack to make the content of 'gnus-parameters variable used by 'gnus-group-split-fancy. I think it's dirty, I post here to propose the idea and hope for a clean solution. I do not like the group parameter customization from the group buffer, I maintain my configuration in a git repository and would like to follow any changes to my groups configuration. So I define a 'my-gnus-group-split-prepare-parameters function to merge 'gnus-parameters and 'newsrc-alist. #+begin_src emacs-lisp (defun my-gnus-group-split-prepare-parameters (&optional parameters) "Take the ALIST of parameters or gnus-parameters and create a fake newsrc structure to use in 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))) ;; FIXME any better solution than (list (list ? (setq newsrc-alist=20 (append newsrc-alist (list (list group nil nil nil nil param)))))))) #+end_src Then I patched 'gnus-group-split-fancy: #+begin_src diff diff --git a/lisp/gnus-mlspl.el b/lisp/gnus-mlspl.el index 3086e2b..b59e841 100644 =2D-- a/lisp/gnus-mlspl.el +++ b/lisp/gnus-mlspl.el @@ -97,7 +97,8 @@ See `gnus-group-split-fancy' for more information. ;;;###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=20 +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 +147,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) (my-gnus-group-split-prep= are-parameters))) split) (dolist (info newsrc) (let ((group (gnus-info-group info)) #+end_src Regards. =2D-=20 Daniel Dehennin R=C3=A9cup=C3=A9rer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iEYEAREKAAYFAk82newACgkQb97L6l6P4FvYKgCeLF95PxTTICbxF+1/M+YkWtp8 irkAn160wxI4ZBp6DgcioBqlfC6ixo7s =umxa -----END PGP SIGNATURE----- --=-=-=--