2001-04-02 Nevin Kapur <nevin@jhu.edu>
authorKai Grossjohann <kgrossjo@eu.uu.net>
Wed, 11 Apr 2001 10:43:40 +0000 (10:43 +0000)
committerKai Grossjohann <kgrossjo@eu.uu.net>
Wed, 11 Apr 2001 10:43:40 +0000 (10:43 +0000)
Committed by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>.

* nnmail.el (nnmail-split-it): Added check for .* at the end of
regexp in nnmail-split-fancy.

lisp/nnmail.el

index 54b3f48..e04d172 100644 (file)
@@ -1233,22 +1233,29 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
      (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.