emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a4bfb0b: Default Emacs to UTF-8 instead of Latin-1


From: Lars Ingebrigtsen
Subject: master a4bfb0b: Default Emacs to UTF-8 instead of Latin-1
Date: Sat, 12 Sep 2020 07:37:38 -0400 (EDT)

branch: master
commit a4bfb0bc5c14e002c0926fc320aeb4a3fc261447
Author: Glenn Morris <rgm@gnu.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Default Emacs to UTF-8 instead of Latin-1
    
    * doc/emacs/mule.texi (File Name Coding): Document it.
    
    * lisp/international/mule-cmds.el (reset-language-environment):
    Default to utf-8 instead of latin-1.
    
    * lisp/mail/sendmail.el (default-sendmail-coding-system): Ditto.
    
    * lisp/mh-e/mh-comp.el (mh-send-letter): Ditto.
---
 doc/emacs/mule.texi             |  7 ++-----
 etc/NEWS                        |  6 ++++++
 lisp/international/mule-cmds.el | 18 +++++++++---------
 lisp/mail/sendmail.el           |  2 +-
 lisp/mh-e/mh-comp.el            |  3 ++-
 5 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 6eff0ca..b780190 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1215,11 +1215,8 @@ system can encode.
 
   If @code{file-name-coding-system} is @code{nil}, Emacs uses a
 default coding system determined by the selected language environment,
-and stored in the @code{default-file-name-coding-system} variable.
-@c FIXME?  Is this correct?  What is the "default language environment"?
-In the default language environment, non-@acronym{ASCII} characters in
-file names are not encoded specially; they appear in the file system
-using the internal Emacs representation.
+and stored in the @code{default-file-name-coding-system} variable
+(normally UTF-8).
 
 @cindex file-name encoding, MS-Windows
 @vindex w32-unicode-filenames
diff --git a/etc/NEWS b/etc/NEWS
index 50ba39c..8ff62b6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -86,6 +86,12 @@ useful on systems such as FreeBSD which ships only with 
"etc/termcap".
 * Changes in Emacs 28.1
 
 +++
+*** Emacs now defaults to UTF-8 instead of ISO-8859-1.
+This is only for the default, where the user has set no LANG (or
+similar) variable or environment.  This change should lead to no
+user-visible changes for normal usage.
+
++++
 ** New variables that hold default buffer names for shell output.
 The new constants 'shell-command-buffer-name' and
 'shell-command-buffer-name-async' store the default buffer names
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index ccc8ac9..e3155df 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -1799,13 +1799,11 @@ The default status is as follows:
    'raw-text)
 
   (set-default-coding-systems nil)
-  (setq default-sendmail-coding-system 'iso-latin-1)
-  ;; On Darwin systems, this should be utf-8-unix, but when this file is loaded
-  ;; that is not yet defined, so we set it in set-locale-environment instead.
-  ;; [Actually, it seems to work fine to use utf-8-unix here, and not just
-  ;; on Darwin.  The previous comment seems to be outdated?
-  ;; See patch at https://debbugs.gnu.org/15803 ]
-  (setq default-file-name-coding-system 'iso-latin-1-unix)
+  (setq default-sendmail-coding-system 'utf-8)
+  (setq default-file-name-coding-system (if (memq system-type
+                                                  '(window-nt ms-dos))
+                                            'iso-latin-1-unix
+                                          'utf-8-unix))
   ;; Preserve eol-type from existing default-process-coding-systems.
   ;; On non-unix-like systems in particular, these may have been set
   ;; carefully by the user, or by the startup code, to deal with the
@@ -1821,8 +1819,10 @@ The default status is as follows:
        (input-coding
         (condition-case nil
             (coding-system-change-text-conversion
-             (cdr default-process-coding-system) 'iso-latin-1)
-          (coding-system-error 'iso-latin-1))))
+             (cdr default-process-coding-system)
+             (if (memq system-type '(window-nt ms-dos)) 'iso-latin-1 'utf-8))
+          (coding-system-error
+           (if (memq system-type '(window-nt ms-dos)) 'iso-latin-1 'utf-8)))))
     (setq default-process-coding-system
          (cons output-coding input-coding)))
 
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index dd6eecb..7610939 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -975,7 +975,7 @@ but lower priority than the local value of 
`buffer-file-coding-system'.
 See also the function `select-message-coding-system'.")
 
 ;;;###autoload
-(defvar default-sendmail-coding-system 'iso-latin-1
+(defvar default-sendmail-coding-system 'utf-8
   "Default coding system for encoding the outgoing mail.
 This variable is used only when `sendmail-coding-system' is nil.
 
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index f7e30bf..8a69adb 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -305,6 +305,7 @@ message and scan line."
   (let ((draft-buffer (current-buffer))
         (file-name buffer-file-name)
         (config mh-previous-window-config)
+        ;; FIXME this is subtly different to select-message-coding-system.
         (coding-system-for-write
          (if (fboundp 'select-message-coding-system)
              (select-message-coding-system) ; Emacs has this since at least 
21.1
@@ -318,7 +319,7 @@ message and scan line."
              (or (and (boundp 'sendmail-coding-system) sendmail-coding-system)
                  (and (default-boundp 'buffer-file-coding-system)
                       (default-value 'buffer-file-coding-system))
-                 'iso-latin-1)))))
+                 'utf-8)))))
     ;; Older versions of spost do not support -msgid and -mime.
     (unless mh-send-uses-spost-flag
       ;; Adding a Message-ID field looks good, makes it easier to search for



reply via email to

[Prev in Thread] Current Thread [Next in Thread]