diff options
author | Simon Marshall <simon@gnu.org> | 1995-03-30 07:10:08 +0000 |
---|---|---|
committer | Simon Marshall <simon@gnu.org> | 1995-03-30 07:10:08 +0000 |
commit | ad63249242d2480fff71cbcb880441695e4a46e9 (patch) | |
tree | f9ec2da358af9ce592a1ea7792bfdbc7b5cba1bd /lisp | |
parent | 7357a6812a1cc0f5028a4e01974510d9cab3bbab (diff) | |
download | emacs-ad63249242d2480fff71cbcb880441695e4a46e9.tar.gz |
Wrap filename character quoting code with save-excursion so following forms
relying on point aren't broken.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/dired.el | 19 |
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)) |