summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorSimon Marshall <simon@gnu.org>1995-03-30 07:10:08 +0000
committerSimon Marshall <simon@gnu.org>1995-03-30 07:10:08 +0000
commitcfd944fc834c1d0f61fc696077b574e31e50d169 (patch)
tree3f7074f6d93021718ecd22c9ad642cc947a457bd /lisp/dired.el
parente6cabe0aa72da24208b9c12b14f4482692b061cb (diff)
downloademacs-cfd944fc834c1d0f61fc696077b574e31e50d169.tar.gz
Wrap filename character quoting code with save-excursion so following forms
relying on point aren't broken.
Diffstat (limited to 'lisp/dired.el')
-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."
;; in dired-noselect.
(insert-directory (expand-file-name dir-or-list) switches wildcard full-p))
;; Quote certain characters, unless ls quoted them for us.
- (cond ((not (string-match "b" dired-actual-switches))
- (setq end (point-marker))
- (goto-char opoint)
- (while (search-forward "\\" end t)
- (replace-match "\\\\" nil t))
- (goto-char opoint)
- (while (search-forward "\^m" end t)
- (replace-match "\\015" nil t))
- (set-marker end nil)))
+ (if (not (string-match "b" dired-actual-switches))
+ (save-excursion
+ (setq end (point-marker))
+ (goto-char opoint)
+ (while (search-forward "\\" end t)
+ (replace-match "\\\\" nil t))
+ (goto-char opoint)
+ (while (search-forward "\^m" end t)
+ (replace-match "\\015" nil t))
+ (set-marker end nil)))
(dired-insert-set-properties opoint (point)))
(setq dired-directory dir-or-list))