changeset 88270:4775e8747134

(rmail-process-new-messages): Remove EOL conversion code. (rmail-decode-messages): Do it here instead.
author Henrik Enberg <henrik.enberg@telia.com>
date Sat, 21 Jan 2006 21:21:26 +0000
parents 5b0c2a78047e
children b2a3243cdc27
files lisp/mail/rmail.el
diffstat 1 files changed, 28 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Sat Jan 21 21:09:57 2006 +0000
+++ b/lisp/mail/rmail.el	Sat Jan 21 21:21:26 2006 +0000
@@ -1736,21 +1736,35 @@
 	(save-restriction
 	  (narrow-to-region start end)
 	  (goto-char (point-min))
-
+	  ;; Detect messages that have been added with DOS line endings
+	  ;; and convert the line endings for such messages.
+	  (when (save-excursion (end-of-line) (= (preceding-char) ?\r))
+	    (let ((buffer-read-only nil)
+		  (buffer-undo t)
+		  (end-marker (copy-marker end)))
+	      (message
+	       "Processing new messages...(converting line endings)")
+	      (save-excursion
+		(goto-char (point-max))
+		(while (search-backward "\r\n" (point-min) t)
+		  (delete-char 1)))
+	      (setq end (marker-position end-marker))
+	      (set-marker end-marker nil)))
+	  ;; Decode message according to its content type.
 	  (setq last-coding-system-used nil)
-	  (or rmail-enable-mime
-	      (not rmail-enable-multibyte)
-	      (let ((mime-charset
-		     (when (and rmail-decode-mime-charset
-				(save-excursion
-				  (goto-char (rmail-header-get-limit))
-				  (let ((case-fold-search t))
-				    (re-search-backward
-				     rmail-mime-charset-pattern
-				     (point-min) t))))
-		       (intern (downcase (match-string 1))))))
-		(rmail-decode-region start (point) mime-charset)))
-
+	  ;; (or rmail-enable-mime
+	  ;;     (not rmail-enable-multibyte)
+	  (when (and (not rmail-enable-mime) rmail-enable-multibyte)
+	    (let ((mime-charset
+		   (when (and rmail-decode-mime-charset
+			      (save-excursion
+				(goto-char (rmail-header-get-limit))
+				(let ((case-fold-search t))
+				  (re-search-backward
+				   rmail-mime-charset-pattern
+				   (point-min) t))))
+		     (intern (downcase (match-string 1))))))
+	      (rmail-decode-region start (point) mime-charset)))
 	  ;; Add an the X-Coding-System header.
 	  (unless (rmail-header-get-header "X-Coding-System")
 	    (let ((val (symbol-name last-coding-system-used)))
@@ -1961,21 +1975,6 @@
 	  (goto-char start)
 	  ;; Bump the new message counter.
 	  (setq new-message-counter (1+ new-message-counter))
-	  ;; I don't understand why the following is done ... -pmr
-	  ;; Detect messages that have been added with DOS line endings
-	  ;; and convert the line endings for such messages.
-	  (if (save-excursion (end-of-line) (= (preceding-char) ?\r))
-	      (let ((buffer-read-only nil)
-		    (buffer-undo t)
-		    (end-marker (copy-marker end)))
-		(message
-                 "Processing new messages...(converting line endings)")
-		(save-excursion
-		  (goto-char (point-max))
-		  (while (search-backward "\r\n" (point-min) t)
-		    (delete-char 1)))
-		(setq end (marker-position end-marker))
-		(set-marker end-marker nil)))
 
 	  ;; Make sure we have an Rmail BABYL attribute header field.
 	  ;; All we can assume is that the Rmail BABYL header field is