]> git.eshelyaron.com Git - emacs.git/commitdiff
(unrmail): If "Mail-From" header is found, append a newline to it.
authorEli Zaretskii <eliz@gnu.org>
Fri, 10 Apr 2009 11:54:53 +0000 (11:54 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 10 Apr 2009 11:54:53 +0000 (11:54 +0000)
lisp/ChangeLog
lisp/mail/unrmail.el

index 0290d2142dde48766afe42b5574202e725f42e0c..bea19285c9aa938ac8b6062c4a8ef1daf4b597e7 100644 (file)
@@ -1,5 +1,8 @@
 2009-04-10  Eli Zaretskii  <eliz@gnu.org>
 
+       * 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
index bb73b82c9eff29b65fb23ab228d23ab0eb2d606f..cd71ec58571dcb3524c808684f725c35f9da2b06 100644 (file)
@@ -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