2001-01-31 15:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 31 Jan 2001 20:55:11 +0000 (20:55 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 31 Jan 2001 20:55:11 +0000 (20:55 +0000)
* gnus-sum.el (gnus-summary-remove-list-identifiers): Similar.

* gnus-art.el (article-hide-list-identifiers): Similar.

2001-01-31  Karl Kleinpaste <karl@charcoal.com>

* nnmail.el (nnmail-remove-list-identifiers): Improved.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el
lisp/nnmail.el

index 66d7f6c..30fbbc6 100644 (file)
@@ -1,3 +1,13 @@
+2001-01-31 15:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-sum.el (gnus-summary-remove-list-identifiers): Similar.
+
+       * gnus-art.el (article-hide-list-identifiers): Similar.
+
+2001-01-31  Karl Kleinpaste <karl@charcoal.com>
+
+       * nnmail.el (nnmail-remove-list-identifiers): Improved.
+
 2001-01-31 09:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * gnus-score.el (gnus-summary-score-entry): match may be an integer.
index aae22d0..4793504 100644 (file)
@@ -1826,15 +1826,14 @@ The `gnus-list-identifiers' variable specifies what to do."
                        (mapconcat 'identity gnus-list-identifiers " *\\|"))))
          (when regexp
            (goto-char (point-min))
-           (when (re-search-forward
-                  (concat "^Subject: +\\(\\(\\(Re: +\\)?\\(" regexp
-                          " *\\)\\)+\\(Re: +\\)?\\)")
-                  nil t)
-             (let ((s (or (match-string 3) (match-string 5))))
-               (delete-region (match-beginning 1) (match-end 1))
-               (when s
-                 (goto-char (match-beginning 1))
-                 (insert s))))))))))
+           (while (re-search-forward
+                   (concat "^Subject: +\\(R[Ee]: +\\)*\\(" regexp " *\\)")
+                   nil t)
+             (delete-region (match-beginning 2) (match-end 0))
+             (beginning-of-line))
+           (when (re-search-forward 
+                  "^Subject: +\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" nil t)
+             (delete-region (match-beginning 1) (match-end 1)))))))))
 
 (defun article-hide-pgp ()
   "Remove any PGP headers and signatures in the current article."
index 34a68b0..5a809f3 100644 (file)
@@ -4257,19 +4257,26 @@ or a straight list of headers."
   "Remove list identifiers in `gnus-list-identifiers' from articles in the current group."
   (let ((regexp (if (stringp gnus-list-identifiers)
                    gnus-list-identifiers
-                 (mapconcat 'identity gnus-list-identifiers " *\\|"))))
+                 (mapconcat 'identity gnus-list-identifiers " *\\|")))
+       changed subject)
     (dolist (header gnus-newsgroup-headers)
-      (when (string-match (concat "\\(\\(\\(Re: +\\)?\\(" regexp
-                                 " *\\)\\)+\\(Re: +\\)?\\)")
-                         (mail-header-subject header))
-       (mail-header-set-subject
-        header (concat (substring (mail-header-subject header)
-                                  0 (match-beginning 1))
-                       (or
-                        (match-string 3 (mail-header-subject header))
-                        (match-string 5 (mail-header-subject header)))
-                       (substring (mail-header-subject header)
-                                  (match-end 1))))))))
+      (setq subject (mail-header-subject header)
+           changed nil)
+      (while (string-match
+             (concat "^\\(R[Ee]: +\\)*\\(" regexp " *\\)")
+             subject)
+       (setq subject
+             (concat (substring subject 0 (match-beginning 2))
+                     (substring subject (match-end 0)))
+             changed t))
+      (when (and changed
+                (string-match
+                  "^\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" subject))
+       (setq subject
+             (concat (substring subject 0 (match-beginning 1))
+                     (substring subject (match-end 1)))))
+      (when changed
+       (mail-header-set-subject header subject)))))
 
 (defun gnus-select-newsgroup (group &optional read-all select-articles)
   "Select newsgroup GROUP.
index 5a47040..3cad576 100644 (file)
@@ -1096,10 +1096,14 @@ Return the number of characters in the body."
                  (mapconcat 'identity nnmail-list-identifiers " *\\|"))))
     (when regexp
       (goto-char (point-min))
-      (when (re-search-forward
-            (concat "^Subject: +\\(Re: +\\)?\\(" regexp " *\\)")
-            nil t)
-       (delete-region (match-beginning 2) (match-end 0))))))
+      (while (re-search-forward
+              (concat "^Subject: +\\(R[Ee]: +\\)*\\(" regexp " *\\)")
+              nil t)
+        (delete-region (match-beginning 2) (match-end 0))
+        (beginning-of-line))
+      (when (re-search-forward "^Subject: +\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" nil t)
+        (delete-region (match-beginning 1) (match-end 1))
+       (beginning-of-line)))))
 
 (defun nnmail-remove-tabs ()
   "Translate TAB characters into SPACE characters."