Gnus development mailing list
 help / color / mirror / Atom feed
* Using gnus-parameters to generate nnmail-split-fancy
@ 2006-09-29 15:16 Daniel 'NebuchadnezzaR' Dehennin
  0 siblings, 0 replies; only message in thread
From: Daniel 'NebuchadnezzaR' Dehennin @ 2006-09-29 15:16 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

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

[-- Attachment #2: gnus-group-split-fancy use gnus-parameters --]
[-- Type: text/plain, Size: 1461 bytes --]

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))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-29 15:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29 15:16 Using gnus-parameters to generate nnmail-split-fancy Daniel 'NebuchadnezzaR' Dehennin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).