changeset 102886:68831fc17805

(rmail-simplified-subject): Normalize whitespace in subject. This resurrects a feature, lost in transition to mbox, whereby Subject is matched even if it's broken into several lines at arbitrary places.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 08 Apr 2009 12:41:48 +0000
parents cea08cb872e1
children 16fb33cc1bdb
files lisp/mail/rmail.el
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Wed Apr 08 12:34:00 2009 +0000
+++ b/lisp/mail/rmail.el	Wed Apr 08 12:41:48 2009 +0000
@@ -3046,6 +3046,10 @@
 	(setq subject (substring subject (match-end 0))))
     (if (string-match "[ \t]+\\'" subject)
 	(setq subject (substring subject 0 (match-beginning 0))))
+    ;; If Subject is long, mailers will break it into several lines at
+    ;; arbitrary places, so normalize whitespace by replacing every
+    ;; run of whitespace characters with a single space.
+    (setq subject (replace-regexp-in-string "[ \t\n]+" " " subject))
     subject))
 
 (defun rmail-simplified-subject-regexp ()