From: Eli Zaretskii Date: Fri, 10 Apr 2009 11:54:53 +0000 (+0000) Subject: (unrmail): If "Mail-From" header is found, append a newline to it. X-Git-Tag: emacs-pretest-23.0.93~168 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=71d8a1403c2992134945daa8737ef44186ed6596;p=emacs.git (unrmail): If "Mail-From" header is found, append a newline to it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0290d2142dd..bea19285c9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-04-10 Eli Zaretskii + * mail/unrmail.el (unrmail): If "Mail-From" header is found, + append a newline to it. + * mail/rmail.el (rmail-unrmail-new-mail) (rmail-unrmail-new-mail-maybe): New functions. (rmail-insert-inbox-text): Use rmail-unrmail-new-mail-maybe to diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index bb73b82c9ef..cd71ec58571 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -191,7 +191,13 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (save-excursion (search-forward "\n\n" nil 'move) (point))) ;; Fetch or construct what we should use in the `From ' line. - (setq mail-from (or (mail-fetch-field "Mail-From") + (setq mail-from (or (let ((from (mail-fetch-field "Mail-From"))) + ;; mail-mbox-from (below) returns a + ;; string that ends in a newline, but + ;; but mail-fetch-field does not, so + ;; we append a newline here. + (if from + (format "%s\n" from))) (mail-mbox-from))) ;; If the message specifies a coding system, use it. @@ -213,7 +219,7 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (goto-char (point-min)) ;; Insert the `From ' line. - (insert mail-from "\n") + (insert mail-from) ;; Record the keywords and attributes in our special way. (insert "X-RMAIL-ATTRIBUTES: " (apply 'string attrs) "\n") (when keywords