From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/63794 Path: news.gmane.org!not-for-mail From: Daniel 'NebuchadnezzaR' Dehennin Newsgroups: gmane.emacs.gnus.general Subject: Using gnus-parameters to generate nnmail-split-fancy Date: Fri, 29 Sep 2006 17:16:47 +0200 Message-ID: <87u02qln34.fsf@thorr.asgardr.info> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1159543445 22591 80.91.229.2 (29 Sep 2006 15:24:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2006 15:24:05 +0000 (UTC) Original-X-From: ding-owner+m12321@lists.math.uh.edu Fri Sep 29 17:24:03 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GTKBr-0003LP-0G for ding-account@gmane.org; Fri, 29 Sep 2006 17:22:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1GTKBd-0007U1-00; Fri, 29 Sep 2006 10:22:01 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1GTK6f-0007Tv-00 for ding@lists.math.uh.edu; Fri, 29 Sep 2006 10:16:53 -0500 Original-Received: from quimby.gnus.org ([80.91.227.211]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1GTK6d-0002Qa-9m for ding@lists.math.uh.edu; Fri, 29 Sep 2006 10:16:53 -0500 Original-Received: from zion.asgardr.info ([82.233.222.74]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1GTK6a-0007CZ-00 for ; Fri, 29 Sep 2006 17:16:48 +0200 Original-Received: from thorr.asgardr.info ([192.168.1.2]) by zion.asgardr.info with esmtp (Exim 4.63) (envelope-from ) id 1GTK6Y-0004US-WE for ding@gnus.org; Fri, 29 Sep 2006 17:16:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=thorr.asgardr.info ident=nebu) by thorr.asgardr.info with esmtp (Exim 4.63) (envelope-from ) id 1GTK6a-0006DE-3J for ding@gnus.org; Fri, 29 Sep 2006 17:16:48 +0200 Original-To: ding@gnus.org Organisation: Dark Church of Emacs User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.52 (gnu/linux) X-Spam-Score: -1.8 (-) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:63794 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hello, Tying to play with Gnus spliting, I see that gnus-group-split-setup do not care about gnus-parameters. I attach a patch to take care of gnus-parameters in gnus-group-split-fancy. I define gnus-group-split-prepare-parameters, it take an optional argument or use gnus-parameters, to return an alist like the (cdr gnus-newsrc-alist), then I append both in gnus-group-split-fancy. What do you think about this idea ? Regards. -- Daniel 'NebuchadnezzaR' Dehennin Récupérer ma clef GPG: gpg --keyserver pgp.mit.edu --recv-keys 0x2A408F69 --=-=-= Content-Disposition: inline; filename=group-split-use-gnus-parameters.diff Content-Description: gnus-group-split-fancy use gnus-parameters Index: gnus-mlspl.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-mlspl.el,v retrieving revision 7.7 diff -u -r7.7 gnus-mlspl.el --- gnus-mlspl.el 8 Feb 2006 04:17:15 -0000 7.7 +++ gnus-mlspl.el 29 Sep 2006 14:57:16 -0000 @@ -97,6 +97,21 @@ (gnus-group-split-update) (nnmail-split-fancy))) +(defun 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 + (append newsrc-alist (list (list group nil nil nil nil param)))))))) + ;;;###autoload (defun gnus-group-split-fancy (&optional groups no-crosspost catch-all) @@ -149,7 +164,8 @@ (any \"\\\\(foo@nowhere\\\\.gov\\\\|foo@localhost\\\\|foo-redist@home\\\\)\" - \"bugs-foo\" - \"rambling-foo\" \"mail.foo\")) \"mail.others\")" - (let* ((newsrc (cdr gnus-newsrc-alist)) + ;; Use parameters in gnus-parameters too + (let* ((newsrc (append (cdr gnus-newsrc-alist) (gnus-group-split-prepare-parameters))) split) (dolist (info newsrc) (let ((group (gnus-info-group info)) --=-=-=--