aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2018-06-17 10:40:29 +0300
committerEli Zaretskii2018-06-17 10:40:29 +0300
commitc6f992b8e30b1d7c2a53a629e1a4be0deda7fb77 (patch)
tree284290a1147544d212c13d6f98cfec005f0deeb9
parent85a1e2f9278381ea2d95102f8fddb20f8eb0da0c (diff)
downloademacs-c6f992b8e30b1d7c2a53a629e1a4be0deda7fb77.tar.gz
emacs-c6f992b8e30b1d7c2a53a629e1a4be0deda7fb77.zip
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)
-rw-r--r--lisp/international/mule-cmds.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8e69a1c7ab2..cf6a8c78d09 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."
988 988
989 ;; If all the defaults failed, ask a user. 989 ;; If all the defaults failed, ask a user.
990 (when (not coding-system) 990 (when (not coding-system)
991 ;; If UTF-8 is in CODINGS, but is not its first member, make
992 ;; it the first one, so it is offered as the default.
993 (and (memq 'utf-8 codings) (not (eq 'utf-8 (car codings)))
994 (setq codings (append '(utf-8) (delq 'utf-8 codings))))
995
991 (setq coding-system (select-safe-coding-system-interactively 996 (setq coding-system (select-safe-coding-system-interactively
992 from to codings unsafe rejected (car codings)))) 997 from to codings unsafe rejected (car codings))))
993 998