From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/58090 Path: main.gmane.org!not-for-mail From: dhedbor@real.com Newsgroups: gmane.emacs.gnus.general Subject: small patch for nnmail (lowercase expand option) Date: Thu, 08 Jul 2004 16:06:00 -0700 Sender: ding-owner@lists.math.uh.edu Message-ID: <874qoije07.fsf@real.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_scarface.real.com-8493-1089327958-0001-2" X-Trace: sea.gmane.org 1089328109 28400 80.91.224.253 (8 Jul 2004 23:08:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2004 23:08:29 +0000 (UTC) Original-X-From: ding-owner+M6631@lists.math.uh.edu Fri Jul 09 01:08:20 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bii03-0005nZ-00 for ; Fri, 09 Jul 2004 01:08:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1Bihxy-0001Ut-00; Thu, 08 Jul 2004 18:06:10 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1Bihxt-0001Uo-00 for ding@lists.math.uh.edu; Thu, 08 Jul 2004 18:06:05 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1Bihxs-0008Ie-7I for ding@lists.math.uh.edu; Thu, 08 Jul 2004 18:06:04 -0500 Original-Received: from scarface.real.com (scarface.real.com [207.188.7.230]) by justine.libertine.org (Postfix) with ESMTP id 691823A0035 for ; Thu, 8 Jul 2004 18:06:03 -0500 (CDT) Original-Received: from atlantis ([::ffff:172.22.133.243]) by scarface.real.com with esmtp; Thu, 08 Jul 2004 16:05:58 -0700 Original-To: ding@gnus.org Original-Lines: 22 User-Agent: Gnus/5.110003 (No Gnus v0.3) XEmacs/21.4 (Security Through Obscurity, linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:58090 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:58090 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_scarface.real.com-8493-1089327958-0001-2 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit 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 --=_scarface.real.com-8493-1089327958-0001-2 Content-Type: text/x-patch; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=nnmail-expand-lowercase.patch 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)) --=_scarface.real.com-8493-1089327958-0001-2--