From: Eli Zaretskii Date: Wed, 8 Apr 2009 12:43:40 +0000 (+0000) Subject: (rmail-simplified-subject): Normalize whitespace in subject. This X-Git-Tag: emacs-pretest-23.0.93~198 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=92655f6c693ecc1502f25f88dee94e4eb7f05cbf;p=emacs.git (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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9459d03a8f6..d4cdf2257c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2009-04-08 Eli Zaretskii + + * mail/rmail.el (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. + 2009-04-08 Nick Roberts * progmodes/gdb-ui.el: Give hint for GDB in Emacs on Mac OSX. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index dec4c07d6e7..a950f903f70 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3046,6 +3046,10 @@ and typical reply prefixes such as Re:." (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 ()