nnmail.el (nnmail-expand-newtext): Further sub-match fixups (bug#12375)
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 12 Feb 2014 08:57:10 +0000 (08:57 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 12 Feb 2014 08:57:10 +0000 (08:57 +0000)
lisp/ChangeLog
lisp/nnmail.el

index fb165c6..28381ea 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-12  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * nnmail.el (nnmail-expand-newtext): Further sub-match fixups
+       (bug#12375).
+
 2014-02-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-art.el (gnus-article-goto-part): Find a button in the body first.
index d88a1bf..d1a0455 100644 (file)
@@ -1393,7 +1393,7 @@ See the documentation for the variable `nnmail-split-fancy' for details."
      ((stringp split)
       (when nnmail-split-tracing
        (push split nnmail-split-trace))
-      (list (nnmail-expand-newtext split)))
+      (list (nnmail-expand-newtext split t)))
 
      ;; Junk the message.
      ((eq split 'junk)
@@ -1513,7 +1513,7 @@ See the documentation for the variable `nnmail-split-fancy' for details."
        ;; on the same split, which will find it immediately in the cache.
        (nnmail-split-it split))))))
 
-(defun nnmail-expand-newtext (newtext)
+(defun nnmail-expand-newtext (newtext &optional fancyp)
   (let ((len (length newtext))
        (pos 0)
        c expanded beg N did-expand)
@@ -1538,6 +1538,10 @@ See the documentation for the variable `nnmail-split-fancy' for details."
          (if (= c ?\&)
              (setq N 0)
            (setq N (- c ?0)))
+         ;; We wrapped the searches in parentheses, so we have to
+         ;; add some parentheses here...
+         (when fancyp
+           (setq N (+ N 3)))
          (when (match-beginning N)
            (push (if nnmail-split-lowercase-expanded
                      (downcase (buffer-substring (match-beginning N)