From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/35586 Path: main.gmane.org!not-for-mail From: Nevin Kapur Newsgroups: gmane.emacs.gnus.general Subject: Re: How to match '[' in nnmail-split-fancy Date: 02 Apr 2001 11:46:35 -0400 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035171308 3934 80.91.224.250 (21 Oct 2002 03:35:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 03:35:08 +0000 (UTC) Return-Path: Original-Received: (qmail 928 invoked by alias); 2 Apr 2001 15:46:37 -0000 Original-Received: (qmail 923 invoked from network); 2 Apr 2001 15:46:37 -0000 Original-Received: from fermat.mts.jhu.edu (root@128.220.17.18) by gnus.org with SMTP; 2 Apr 2001 15:46:37 -0000 Original-Received: (from kapur@localhost) by fermat.mts.jhu.edu (8.11.0/8.11.0) id f32Fka704219; Mon, 2 Apr 2001 11:46:36 -0400 X-Authentication-Warning: fermat.mts.jhu.edu: kapur set sender to nevin@jhu.edu using -f Original-To: ding@gnus.org X-Face: 5qz+Fg"Lb1Z3i<6h&9Ax$jfq]k{-f:z_Uk_fQ_DOy|7;xWm4@bDK52s/-A\!8g'3a}peKv> u;mMlqf!3"K"X5B;2E|Nz}< (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Mon, 02 Apr 2001 08:05:30 +0200") User-Agent: Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.2 (Urania) Original-Lines: 75 Xref: main.gmane.org gmane.emacs.gnus.general:35586 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:35586 On Mon, 02 Apr 2001, Kai Großjohann wrote: > I think a similar trick should be done for the end of the regexp. > Hm... Yes, look after line 1232 in nnmail.el, there you can see the > special case for splits beginning with ".*". I think partial should > be renamed to partial-front and a similar partial-rear variable > should be introduced. > > Opinions? It makes sense to me. If there is a consensus to add this twist, here's the patch against the latest CVS. cvs server: Diffing lisp Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 6.393 diff -u -r6.393 ChangeLog --- lisp/ChangeLog 2001/04/01 23:25:12 6.393 +++ lisp/ChangeLog 2001/04/01 15:35:16 @@ -1,3 +1,8 @@ +2001-04-02 Nevin Kapur + + * nnmail.el (nnmail-split-it): Added check for .* at the end of + regexp in nnmail-split-fancy. + 2001-04-02 00:40:12 Lars Magne Ingebrigtsen * message.el (message-check-news-header-syntax): Question even Index: lisp/nnmail.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v retrieving revision 6.10 diff -u -r6.10 nnmail.el --- lisp/nnmail.el 2001/02/08 23:53:22 6.10 +++ lisp/nnmail.el 2001/04/01 15:35:20 @@ -1233,22 +1233,29 @@ (t (let* ((field (nth 0 split)) (value (nth 1 split)) - partial regexp) + partial-front regexp + partial-rear regexp) (if (symbolp value) (setq value (cdr (assq value nnmail-split-abbrev-alist)))) (if (and (>= (length value) 2) (string= ".*" (substring value 0 2))) (setq value (substring value 2) - partial "")) + partial-front "")) + ;; Same trick for the rear of the regexp + (if (and (>= (length value) 2) + (string= ".*" (substring value -2))) + (setq value (substring value 0 -2) + partial-rear "")) (setq regexp (concat "^\\(\\(" (if (symbolp field) (cdr (assq field nnmail-split-abbrev-alist)) field) "\\):.*\\)" - (or partial "\\<") + (or partial-front "\\<") "\\(" value - "\\)\\>")) + "\\)" + (or partial-rear "\\>"))) (push (cons split regexp) nnmail-split-cache) ;; Now that it's in the cache, just call nnmail-split-it again ;; on the same split, which will find it immediately in the cache. -- Nevin