diff options
| author | Andreas Schwab | 2002-10-16 21:32:41 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2002-10-16 21:32:41 +0000 |
| commit | 349254d330a2cd3d952ab5a6dcef0360eff3b1a3 (patch) | |
| tree | 16782d11d37ceffee6a38548e9ef03b1fce3309d | |
| parent | 34cd7b3ca0b94652de6da85373e62f7bc0a99e8d (diff) | |
| download | emacs-349254d330a2cd3d952ab5a6dcef0360eff3b1a3.tar.gz emacs-349254d330a2cd3d952ab5a6dcef0360eff3b1a3.zip | |
(dired-insert-subdir-doinsert): Preserve point.
| -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." | |||
| 1728 | (defun dired-insert-subdir-doinsert (dirname switches) | 1728 | (defun dired-insert-subdir-doinsert (dirname switches) |
| 1729 | ;; Insert ls output after point. | 1729 | ;; Insert ls output after point. |
| 1730 | ;; Return the boundary of the inserted text (as list of BEG and END). | 1730 | ;; Return the boundary of the inserted text (as list of BEG and END). |
| 1731 | (let ((begin (point))) | 1731 | (save-excursion |
| 1732 | (message "Reading directory %s..." dirname) | 1732 | (let ((begin (point))) |
| 1733 | (let ((dired-actual-switches | 1733 | (message "Reading directory %s..." dirname) |
| 1734 | (or switches | 1734 | (let ((dired-actual-switches |
| 1735 | (dired-replace-in-string "R" "" dired-actual-switches)))) | 1735 | (or switches |
| 1736 | (if (equal dirname (car (car (last dired-subdir-alist)))) | 1736 | (dired-replace-in-string "R" "" dired-actual-switches)))) |
| 1737 | ;; If doing the top level directory of the buffer, | 1737 | (if (equal dirname (car (car (last dired-subdir-alist)))) |
| 1738 | ;; redo it as specified in dired-directory. | 1738 | ;; If doing the top level directory of the buffer, |
| 1739 | (dired-readin-insert) | 1739 | ;; redo it as specified in dired-directory. |
| 1740 | (let ((pt (point))) | 1740 | (dired-readin-insert) |
| 1741 | (dired-insert-directory dirname dired-actual-switches nil nil t) | 1741 | (dired-insert-directory dirname dired-actual-switches nil nil t))) |
| 1742 | (goto-char pt)))) | 1742 | (message "Reading directory %s...done" dirname) |
| 1743 | (message "Reading directory %s...done" dirname) | 1743 | (list begin (point))))) |
| 1744 | (list begin (point)))) | ||
| 1745 | 1744 | ||
| 1746 | (defun dired-insert-subdir-doupdate (dirname elt beg-end) | 1745 | (defun dired-insert-subdir-doupdate (dirname elt beg-end) |
| 1747 | ;; Point is at the correct subdir alist position for ELT, | 1746 | ;; Point is at the correct subdir alist position for ELT, |