1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 02:31:03 -08:00

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.
This commit is contained in:
Paul Eggert 2017-08-19 17:15:52 -07:00
parent 1c382c096b
commit 83f0d60e49
5 changed files with 67 additions and 10 deletions

View file

@ -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)