From 6ab02695bceae801cd907fd080a287f1e85917a9 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 31 Jan 2001 23:41:06 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 8 ++++++++ lisp/gnus-art.el | 35 ++++++++++++++++++----------------- lisp/gnus-sum.el | 43 ++++++++++++++++++++++--------------------- lisp/nnmail.el | 6 ++++-- 4 files changed, 52 insertions(+), 40 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6bbf2e8..b1f6e2a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2001-01-31 18:00:00 ShengHuo ZHU + + * nnmail.el (nnmail-remove-list-identifiers): Use consp. + + * gnus-art.el (article-hide-list-identifiers): Ditto. + + * gnus-sum.el (gnus-summary-remove-list-identifiers): Ditto. + 2001-01-31 15:00:00 ShengHuo ZHU * gnus-sum.el (gnus-summary-remove-list-identifiers): Similar. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 1108eba..fddef97 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1972,23 +1972,24 @@ If FORCE, decode the article whether it is marked as base64 not." "Remove list identifies from the Subject header. The `gnus-list-identifiers' variable specifies what to do." (interactive) - (save-excursion - (save-restriction - (let ((inhibit-point-motion-hooks t) - buffer-read-only) - (article-narrow-to-head) - (let ((regexp (if (stringp gnus-list-identifiers) gnus-list-identifiers - (mapconcat 'identity gnus-list-identifiers " *\\|")))) - (when regexp - (goto-char (point-min)) - (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))))))))) + (let ((inhibit-point-motion-hooks t) + (regexp (if (consp gnus-list-identifiers) + (mapconcat 'identity gnus-list-identifiers " *\\|") + gnus-list-identifiers)) + buffer-read-only) + (when regexp + (save-excursion + (save-restriction + (article-narrow-to-head) + (goto-char (point-min)) + (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." diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 089376b..baa6065 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -4282,28 +4282,29 @@ or a straight list of headers." (defun gnus-summary-remove-list-identifiers () "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 " *\\|"))) + (let ((regexp (if (consp gnus-list-identifiers) + (mapconcat 'identity gnus-list-identifiers " *\\|") + gnus-list-identifiers)) changed subject) - (dolist (header gnus-newsgroup-headers) - (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))))) + (when regexp + (dolist (header gnus-newsgroup-headers) + (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. diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 3b59d16..cb70183 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1102,8 +1102,10 @@ Return the number of characters in the body." (defun nnmail-remove-list-identifiers () "Remove list identifiers from Subject headers." - (let ((regexp (if (stringp nnmail-list-identifiers) nnmail-list-identifiers - (mapconcat 'identity nnmail-list-identifiers " *\\|")))) + (let ((regexp + (if (consp nnmail-list-identifiers) + (mapconcat 'identity nnmail-list-identifiers " *\\|") + nnmail-list-identifiers))) (when regexp (goto-char (point-min)) (while (re-search-forward -- 1.7.10.4