emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master c6f992b: When possible, prefer UTF-8 as the safe en


From: Eli Zaretskii
Subject: [Emacs-diffs] master c6f992b: When possible, prefer UTF-8 as the safe encoding for saving
Date: Sun, 17 Jun 2018 03:42:05 -0400 (EDT)

branch: master
commit c6f992b8e30b1d7c2a53a629e1a4be0deda7fb77
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    When possible, prefer UTF-8 as the safe encoding for saving
    
    * lisp/international/mule-cmds.el (select-safe-coding-system):
    If possible, offer UTF-8 as the default encoding.  (Bug#31807)
---
 lisp/international/mule-cmds.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8e69a1c..cf6a8c7 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -988,6 +988,11 @@ It is highly recommended to fix it before writing to a 
file."
 
       ;; If all the defaults failed, ask a user.
       (when (not coding-system)
+        ;; If UTF-8 is in CODINGS, but is not its first member, make
+        ;; it the first one, so it is offered as the default.
+        (and (memq 'utf-8 codings) (not (eq 'utf-8 (car codings)))
+             (setq codings (append '(utf-8) (delq 'utf-8 codings))))
+
        (setq coding-system (select-safe-coding-system-interactively
                             from to codings unsafe rejected (car codings))))
 



reply via email to

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