Gnus development mailing list
 help / color / mirror / Atom feed
* small patch for nnmail (lowercase expand option)
@ 2004-07-08 23:06 dhedbor
  2004-07-08 23:11 ` dhedbor
  0 siblings, 1 reply; 7+ messages in thread
From: dhedbor @ 2004-07-08 23:06 UTC (permalink / 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))

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-12 17:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-08 23:06 small patch for nnmail (lowercase expand option) dhedbor
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

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