aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2003-05-24 20:16:33 +0000
committerAndreas Schwab2003-05-24 20:16:33 +0000
commit0bded0655ab70b59afdf7e358728999d2b514cd3 (patch)
tree77793d43e926574b5d7026c97f57c1a0a8f062ef
parent58f993792861d7288170110274c1eb453b0cd9fc (diff)
downloademacs-0bded0655ab70b59afdf7e358728999d2b514cd3.tar.gz
emacs-0bded0655ab70b59afdf7e358728999d2b514cd3.zip
(insert-directory): Preserve CR in a file name.
-rw-r--r--lisp/files.el8
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'."
4304 file-name-coding-system 4304 file-name-coding-system
4305 default-file-name-coding-system 4305 default-file-name-coding-system
4306 'undecided)) 4306 'undecided))
4307 coding-no-eol
4307 val pos) 4308 val pos)
4308 (when (and enable-multibyte-characters 4309 (when (and enable-multibyte-characters
4309 (not (memq (coding-system-base coding) 4310 (not (memq (coding-system-base coding)
@@ -4314,6 +4315,8 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
4314 (setq coding (detect-coding-region beg (point) t))) 4315 (setq coding (detect-coding-region beg (point) t)))
4315 (if (not (eq (coding-system-base coding) 'undecided)) 4316 (if (not (eq (coding-system-base coding) 'undecided))
4316 (save-restriction 4317 (save-restriction
4318 (setq coding-no-eol
4319 (coding-system-change-eol-conversion coding 'unix))
4317 (narrow-to-region beg (point)) 4320 (narrow-to-region beg (point))
4318 (goto-char (point-min)) 4321 (goto-char (point-min))
4319 (while (not (eobp)) 4322 (while (not (eobp))
@@ -4321,7 +4324,10 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
4321 val (get-text-property (point) 'dired-filename)) 4324 val (get-text-property (point) 'dired-filename))
4322 (goto-char (next-single-property-change 4325 (goto-char (next-single-property-change
4323 (point) 'dired-filename nil (point-max))) 4326 (point) 'dired-filename nil (point-max)))
4324 (decode-coding-region pos (point) coding) 4327 ;; Force no eol conversion on a file name, so
4328 ;; that CR is preserved.
4329 (decode-coding-region pos (point)
4330 (if val coding-no-eol coding))
4325 (if val 4331 (if val
4326 (put-text-property pos (point) 4332 (put-text-property pos (point)
4327 'dired-filename t))))))) 4333 'dired-filename t)))))))