comparison lisp/mail/rmail.el @ 67469:b845fff9455c

(rmail-next-same-subject): Handle multiple "Re: " strings and long subject lines that were broken into multiple lines at arbitrary places.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 10 Dec 2005 11:29:53 +0000
parents ed770a0a7846
children 17b9be3ce6af
comparison
equal deleted inserted replaced
67468:4d92860b8e50 67469:b845fff9455c
3153 (i rmail-current-message) 3153 (i rmail-current-message)
3154 (case-fold-search t) 3154 (case-fold-search t)
3155 search-regexp found) 3155 search-regexp found)
3156 (if (string-match "\\`[ \t]+" subject) 3156 (if (string-match "\\`[ \t]+" subject)
3157 (setq subject (substring subject (match-end 0)))) 3157 (setq subject (substring subject (match-end 0))))
3158 (if (string-match "Re:[ \t]*" subject) 3158 (if (string-match "\\`\\(Re:[ \t]*\\)+" subject)
3159 (setq subject (substring subject (match-end 0)))) 3159 (setq subject (substring subject (match-end 0))))
3160 (if (string-match "[ \t]+\\'" subject) 3160 (if (string-match "[ \t]+\\'" subject)
3161 (setq subject (substring subject 0 (match-beginning 0)))) 3161 (setq subject (substring subject 0 (match-beginning 0))))
3162 (setq search-regexp (concat "^Subject: *\\(Re:[ \t]*\\)?" 3162 ;; If Subject is long, mailers will break it into several lines at
3163 (regexp-quote subject) 3163 ;; arbitrary places, so replace whitespace with a regexp that will
3164 "[ \t]*\n")) 3164 ;; match any sequence of spaces, TABs, and newlines.
3165 (setq subject (regexp-quote subject))
3166 (setq subject
3167 (replace-regexp-in-string "[ \t\n]+" "[ \t\n]+" subject t t))
3168 (setq search-regexp (concat "^Subject: *\\(Re:[ \t]*\\)*"
3169 subject "[ \t]*\n"))
3165 (save-excursion 3170 (save-excursion
3166 (save-restriction 3171 (save-restriction
3167 (widen) 3172 (widen)
3168 (while (and (/= n 0) 3173 (while (and (/= n 0)
3169 (if forward 3174 (if forward