diff options
author | Andreas Schwab <schwab@suse.de> | 2002-10-16 21:32:41 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2002-10-16 21:32:41 +0000 |
commit | 349254d330a2cd3d952ab5a6dcef0360eff3b1a3 (patch) | |
tree | 16782d11d37ceffee6a38548e9ef03b1fce3309d /lisp/dired-aux.el | |
parent | 34cd7b3ca0b94652de6da85373e62f7bc0a99e8d (diff) | |
download | emacs-349254d330a2cd3d952ab5a6dcef0360eff3b1a3.tar.gz |
(dired-insert-subdir-doinsert): Preserve point.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r-- | lisp/dired-aux.el | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index ea6cdef8fc6..b34935c45e1 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1728,20 +1728,19 @@ With optional arg REMEMBER-MARKS, return an alist of marked files." (defun dired-insert-subdir-doinsert (dirname switches) ;; Insert ls output after point. ;; Return the boundary of the inserted text (as list of BEG and END). - (let ((begin (point))) - (message "Reading directory %s..." dirname) - (let ((dired-actual-switches - (or switches - (dired-replace-in-string "R" "" dired-actual-switches)))) - (if (equal dirname (car (car (last dired-subdir-alist)))) - ;; If doing the top level directory of the buffer, - ;; redo it as specified in dired-directory. - (dired-readin-insert) - (let ((pt (point))) - (dired-insert-directory dirname dired-actual-switches nil nil t) - (goto-char pt)))) - (message "Reading directory %s...done" dirname) - (list begin (point)))) + (save-excursion + (let ((begin (point))) + (message "Reading directory %s..." dirname) + (let ((dired-actual-switches + (or switches + (dired-replace-in-string "R" "" dired-actual-switches)))) + (if (equal dirname (car (car (last dired-subdir-alist)))) + ;; If doing the top level directory of the buffer, + ;; redo it as specified in dired-directory. + (dired-readin-insert) + (dired-insert-directory dirname dired-actual-switches nil nil t))) + (message "Reading directory %s...done" dirname) + (list begin (point))))) (defun dired-insert-subdir-doupdate (dirname elt beg-end) ;; Point is at the correct subdir alist position for ELT, |