Gnus development mailing list
 help / color / mirror / Atom feed
From: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
To: ding@gnus.org
Subject: Group splitting on list headers
Date: Sat, 14 Dec 2013 18:03:04 +0100	[thread overview]
Message-ID: <87iouruzzr.fsf@hati.baby-gnu.org> (raw)

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

Hello,

I'm heavily using Group splitting and I have an issue with mailing-list
and cross-posting.

I'm looking at splitting on mailing-list headers and wonder if this is
the correct way of doing it.

I first create a new “list” abbrev:

#+begin_src diff
diff --git a/lisp/nnmail.el b/lisp/nnmail.el
index 5be449e..73023df 100644
--- a/lisp/nnmail.el
+++ b/lisp/nnmail.el
@@ -517,6 +517,7 @@ Example:
 (defcustom nnmail-split-abbrev-alist
   '((any . "from\\|to\\|cc\\|sender\\|apparently-to\\|resent-from\\|resent-to\\|resent-cc")
     (mail . "mailer-daemon\\|postmaster\\|uucp")
+    (list . "List-Post\\|X-BeenThere\\|X-Loop\||X-.*List")
     (to . "to\\|cc\\|apparently-to\\|resent-to\\|resent-cc")
     (from . "from\\|sender\\|resent-from")
     (nato . "to\\|cc\\|resent-to\\|resent-cc")
#+end_src

And then I use the “subscribed” group parameter to discriminate the use
of “list” in place of “any”

#+begin_src diff
diff --git a/lisp/gnus-mlspl.el b/lisp/gnus-mlspl.el
index 3947c67..303aec5 100644
--- a/lisp/gnus-mlspl.el
+++ b/lisp/gnus-mlspl.el
@@ -177,7 +177,10 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
 		    (to-list (cdr (assoc 'to-list params)))
 		    (extra-aliases (cdr (assoc 'extra-aliases params)))
 		    (split-regexp (cdr (assoc 'split-regexp params)))
-		    (split-exclude (cdr (assoc 'split-exclude params))))
+		    (split-exclude (cdr (assoc 'split-exclude params)))
+		    (target (if (cdr (assoc 'subscribed params))
+				'list
+			      'any)))
 		(when (or to-address to-list extra-aliases split-regexp)
 		  ;; regexp-quote to-address, to-list and extra-aliases
 		  ;; and add them all to split-regexp
@@ -198,7 +201,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
 			 "\\)"))
 		  ;; Now create the new SPLIT
 		  (push (append
-			 (list 'any split-regexp)
+			 (list target split-regexp)
 			 ;; Generate RESTRICTs for SPLIT-EXCLUDEs.
 			 (if (listp split-exclude)
 			     (apply #'append
#+end_src

I wonder if using the “subscribed” is a good thing or maybe should I
define a new group parameter?

Regards.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x7A6FE2DF

[-- Attachment #2: Type: application/pgp-signature, Size: 229 bytes --]

             reply	other threads:[~2013-12-14 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-14 17:03 Daniel Dehennin [this message]
2013-12-26 15:47 ` Lars Ingebrigtsen
2013-12-26 16:58   ` Daniel Dehennin
2013-12-26 16:59     ` Lars Ingebrigtsen
2013-12-27 15:57       ` [PATCH] " Daniel Dehennin
2013-12-28  1:53         ` Daniel Dehennin
2013-12-29  0:25         ` Daniel Dehennin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iouruzzr.fsf@hati.baby-gnu.org \
    --to=daniel.dehennin@baby-gnu.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).