Gnus development mailing list
 help / color / mirror / Atom feed
From: dhedbor@real.com
Subject: small patch for nnmail (lowercase expand option)
Date: Thu, 08 Jul 2004 16:06:00 -0700	[thread overview]
Message-ID: <874qoije07.fsf@real.com> (raw)

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

Hello. I just recently started using fancy splitting of mailing
lists. It worked great except for one thing - if someone sent a mail
to Mailing-List-dev@domain, it got sorted into lists.dev.Mailing-List
rather than the desired lists.dev.mailing-list.

After some research it seems like Gnus doesn't support lowercasing the
expanded text so I decided to add it. The patch is attached.

One small note: It might be more correct to add support for the
features used in replace-match, i.e \l, \L and such (or perhaps it's
possible to use the replace-match somehow, I don't know). However all
_I_ needed was lowercasing and also my lisp skills are somewhat
lacking so I don't want to attempt to make such a change.

Never the less, I figured I could just as well ship this patch to the
list for possible inclusion.

-- 
David Hedbor, Software Development Engineer - Real Networks
Helix Community: http://helixcommunity.org

[-- Attachment #2: nnmail-expand-lowercase.patch --]
[-- Type: text/x-patch, Size: 1257 bytes --]

Index: lisp/nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 7.9
diff -u -r7.9 nnmail.el
--- lisp/nnmail.el	20 May 2004 08:02:40 -0000	7.9
+++ lisp/nnmail.el	8 Jul 2004 23:03:39 -0000
@@ -574,6 +574,15 @@
   :group 'nnmail
   :type 'boolean)
 
+(defcustom nnmail-split-fancy-lowercase-expanded nil
+
+  "Whether to match lowercase expanded entries (i.e \\N) or leave them
+as-is when using fancy splitting. This avoids the creation of multiple
+groups when users send to an address using different case (i.e 
+mailing-list@domain vs Mailing-List@Domain)."
+  :group 'nnmail
+  :type 'boolean)
+
 ;;; Internal variables.
 
 (defvar nnmail-article-buffer " *nnmail incoming*"
@@ -1464,8 +1473,11 @@
 	      (setq N 0)
 	    (setq N (- c ?0)))
 	  (when (match-beginning N)
-	    (push (buffer-substring (match-beginning N) (match-end N))
-		  expanded))))
+	    (let ((tmp-match (buffer-substring (match-beginning N)
+					       (match-end N))))
+	      (if nnmail-split-fancy-lowercase-expanded
+		  (push (downcase tmp-match) expanded)
+		(push tmp-match expanded))))))
       (setq pos (1+ pos)))
     (if did-expand
 	(apply 'concat (nreverse expanded))

             reply	other threads:[~2004-07-08 23:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-08 23:06 dhedbor [this message]
2004-07-08 23:11 ` dhedbor
2004-07-09  1:49   ` Katsumi Yamaoka
2004-07-09 13:07     ` Marcelo Toledo
2004-07-09 15:49       ` Katsumi Yamaoka
2004-07-12  6:33     ` Katsumi Yamaoka
2004-07-12 17:08       ` dhedbor

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=874qoije07.fsf@real.com \
    --to=dhedbor@real.com \
    /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).