]> git.eshelyaron.com Git - emacs.git/commitdiff
(select-message-coding-system): Be
authorKenichi Handa <handa@m17n.org>
Fri, 29 Jul 2005 01:44:52 +0000 (01:44 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 29 Jul 2005 01:44:52 +0000 (01:44 +0000)
sure to use LF for end-of-line.  If no coding system is decided,
return iso-8859-1-unix.

lisp/international/mule-cmds.el

index 077a196f47426956db8544e2c2a1d434124de668..acd5373214031554f7722c9a14ef20c8434080a0 100644 (file)
@@ -1027,10 +1027,19 @@ it asks the user to select a proper coding system."
        ;; We should never use no-conversion for outgoing mail.
        (setq coding nil))
     (if (fboundp select-safe-coding-system-function)
-       (funcall select-safe-coding-system-function
-                (point-min) (point-max) coding
-                (function (lambda (x) (coding-system-get x 'mime-charset))))
-      coding)))
+       (setq coding
+             (funcall select-safe-coding-system-function
+                      (point-min) (point-max) coding
+                      (function (lambda (x)
+                                  (coding-system-get x 'mime-charset))))))
+    (if coding
+       ;; Be sure to use LF for end-of-line.
+       (setq coding (coding-system-change-eol-conversion coding 'unix))
+      ;; No coding system is decided.  Usually this is the case that
+      ;; the current buffer contains only ASCII.  So, we hope
+      ;; iso-8859-1 works.
+      (setq coding 'iso-8859-1-unix))
+    coding))
 \f
 ;;; Language support stuff.