aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Marshall1995-03-30 07:10:08 +0000
committerSimon Marshall1995-03-30 07:10:08 +0000
commitad63249242d2480fff71cbcb880441695e4a46e9 (patch)
treef9ec2da358af9ce592a1ea7792bfdbc7b5cba1bd
parent7357a6812a1cc0f5028a4e01974510d9cab3bbab (diff)
downloademacs-ad63249242d2480fff71cbcb880441695e4a46e9.tar.gz
emacs-ad63249242d2480fff71cbcb880441695e4a46e9.zip
Wrap filename character quoting code with save-excursion so following forms
relying on point aren't broken.
-rw-r--r--lisp/dired.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 03637103a34..7c8e65a23d9 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -552,15 +552,16 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
552 ;; in dired-noselect. 552 ;; in dired-noselect.
553 (insert-directory (expand-file-name dir-or-list) switches wildcard full-p)) 553 (insert-directory (expand-file-name dir-or-list) switches wildcard full-p))
554 ;; Quote certain characters, unless ls quoted them for us. 554 ;; Quote certain characters, unless ls quoted them for us.
555 (cond ((not (string-match "b" dired-actual-switches)) 555 (if (not (string-match "b" dired-actual-switches))
556 (setq end (point-marker)) 556 (save-excursion
557 (goto-char opoint) 557 (setq end (point-marker))
558 (while (search-forward "\\" end t) 558 (goto-char opoint)
559 (replace-match "\\\\" nil t)) 559 (while (search-forward "\\" end t)
560 (goto-char opoint) 560 (replace-match "\\\\" nil t))
561 (while (search-forward "\^m" end t) 561 (goto-char opoint)
562 (replace-match "\\015" nil t)) 562 (while (search-forward "\^m" end t)
563 (set-marker end nil))) 563 (replace-match "\\015" nil t))
564 (set-marker end nil)))
564 (dired-insert-set-properties opoint (point))) 565 (dired-insert-set-properties opoint (point)))
565 (setq dired-directory dir-or-list)) 566 (setq dired-directory dir-or-list))
566 567