diff options
| author | Eli Zaretskii | 2005-12-10 11:30:33 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2005-12-10 11:30:33 +0000 |
| commit | 7c86d70e27dd91222d2894e18524086d4ad7dee9 (patch) | |
| tree | 964797bbffd3a00b4c1c500cbdd4d2faaa52c2e3 | |
| parent | d9f9aa720f0bb1ebfb3fd9e9e678da25c7bbf271 (diff) | |
| download | emacs-7c86d70e27dd91222d2894e18524086d4ad7dee9.tar.gz emacs-7c86d70e27dd91222d2894e18524086d4ad7dee9.zip | |
(rmail-next-same-subject): Handle multiple "Re: " strings and long subject
lines that were broken into multiple lines at arbitrary places.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mail/rmail.el | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39237924e11..fc01691525f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2005-12-10 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * mail/rmail.el (rmail-next-same-subject): Handle multiple "Re: " | ||
| 4 | strings and long subject lines that were broken into multiple | ||
| 5 | lines at arbitrary places. | ||
| 6 | |||
| 1 | 2005-12-10 John W. Eaton <jwe@octave.org> | 7 | 2005-12-10 John W. Eaton <jwe@octave.org> |
| 2 | 8 | ||
| 3 | * emacs/octave-mod.el (octave-electric-space): Don't indent | 9 | * emacs/octave-mod.el (octave-electric-space): Don't indent |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 0decf2813aa..b45467386ba 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -3155,13 +3155,18 @@ If N is negative, go backwards instead." | |||
| 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) |