diff options
author | Andreas Schwab <schwab@suse.de> | 2003-05-24 20:16:33 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2003-05-24 20:16:33 +0000 |
commit | 0bded0655ab70b59afdf7e358728999d2b514cd3 (patch) | |
tree | 77793d43e926574b5d7026c97f57c1a0a8f062ef /lisp | |
parent | 58f993792861d7288170110274c1eb453b0cd9fc (diff) | |
download | emacs-0bded0655ab70b59afdf7e358728999d2b514cd3.tar.gz |
(insert-directory): Preserve CR in a file name.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/files.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index 67b8b6adba3..26235275261 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4304,6 +4304,7 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." file-name-coding-system default-file-name-coding-system 'undecided)) + coding-no-eol val pos) (when (and enable-multibyte-characters (not (memq (coding-system-base coding) @@ -4314,6 +4315,8 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." (setq coding (detect-coding-region beg (point) t))) (if (not (eq (coding-system-base coding) 'undecided)) (save-restriction + (setq coding-no-eol + (coding-system-change-eol-conversion coding 'unix)) (narrow-to-region beg (point)) (goto-char (point-min)) (while (not (eobp)) @@ -4321,7 +4324,10 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." val (get-text-property (point) 'dired-filename)) (goto-char (next-single-property-change (point) 'dired-filename nil (point-max))) - (decode-coding-region pos (point) coding) + ;; Force no eol conversion on a file name, so + ;; that CR is preserved. + (decode-coding-region pos (point) + (if val coding-no-eol coding)) (if val (put-text-property pos (point) 'dired-filename t))))))) |