summaryrefslogtreecommitdiff
path: root/lisp/international/mule-cmds.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-08-19 17:15:52 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-08-19 17:17:09 -0700
commit83f0d60e498c9cab59e098af6d9c403631ad645c (patch)
tree38c3968b19d8eb83dc8c0b7c446330bd43383a42 /lisp/international/mule-cmds.el
parent1c382c096b8b7d1fa995e6131b887d9128085c68 (diff)
downloademacs-83f0d60e498c9cab59e098af6d9c403631ad645c.tar.gz
Don’t adjust CRLF in file names
* doc/misc/gnus.texi (Non-ASCII Group Names): * etc/NEWS: * test/lisp/net/tramp-tests.el (tramp--test-utf8): Use utf-8-unix, not utf-8, for default-file-name-coding-system, so that CRLF in file names is left alone. * lisp/international/mule-cmds.el (set-default-coding-systems): Do not alter CRLF in file name coding systems. (prefer-coding-system): Ignore differences in CRLF processing when checking whether we used the user-specified file name coding system. * test/src/fileio-tests.el: New file.
Diffstat (limited to 'lisp/international/mule-cmds.el')
-rw-r--r--lisp/international/mule-cmds.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index ee31dea69ec..338ca6a6e3c 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -354,11 +354,12 @@ This also sets the following values:
(if (eq system-type 'darwin)
;; The file-name coding system on Darwin systems is always utf-8.
- (setq default-file-name-coding-system 'utf-8)
+ (setq default-file-name-coding-system 'utf-8-unix)
(if (and (default-value 'enable-multibyte-characters)
(or (not coding-system)
(coding-system-get coding-system 'ascii-compatible-p)))
- (setq default-file-name-coding-system coding-system)))
+ (setq default-file-name-coding-system
+ (coding-system-change-eol-conversion coding-system 'unix))))
(setq default-terminal-coding-system coding-system)
;; Prevent default-terminal-coding-system from converting ^M to ^J.
(setq default-keyboard-coding-system
@@ -414,7 +415,7 @@ To prefer, for instance, utf-8, say the following:
(coding-system-change-eol-conversion base eol-type)))
(set-default-coding-systems base)
(if (called-interactively-p 'interactive)
- (or (eq base default-file-name-coding-system)
+ (or (eq base (coding-system-type default-file-name-coding-system))
(message "The default value of `file-name-coding-system' was not changed because the specified coding system is not suitable for file names.")))))
(defvar sort-coding-systems-predicate nil
@@ -1797,9 +1798,9 @@ The default status is as follows:
(set-default-coding-systems nil)
(setq default-sendmail-coding-system 'iso-latin-1)
- ;; On Darwin systems, this should be utf-8, but when this file is loaded
- ;; utf-8 is not yet defined, so we set it in set-locale-environment instead.
- (setq default-file-name-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.
+ (setq default-file-name-coding-system 'iso-latin-1-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
@@ -2722,7 +2723,7 @@ See also `locale-charset-language-names', `locale-language-names',
(when (eq system-type 'darwin)
;; On Darwin, file names are always encoded in utf-8, no matter
;; the locale.
- (setq default-file-name-coding-system 'utf-8)
+ (setq default-file-name-coding-system 'utf-8-unix)
;; macOS's Terminal.app by default uses utf-8 regardless of
;; the locale.
(when (and (null window-system)