Commit 6b4b13eb authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Preserve point in Dired windows under 'dired-auto-revert-buffer'

* lisp/dired.el (dired-find-file): When dired-auto-revert-buffer
is non-nil, bind switch-to-buffer-preserve-window-point to nil
while calling find-file.  (Bug#27243)
parent 39121649
......@@ -2126,7 +2126,16 @@ directory in another window."
(interactive)
;; Bind `find-file-run-dired' so that the command works on directories
;; too, independent of the user's setting.
(let ((find-file-run-dired t))
(let ((find-file-run-dired t)
;; This binding prevents problems with preserving point in
;; windows displaying Dired buffers, because reverting a Dired
;; buffer empties it, which changes the places where the
;; markers used by switch-to-buffer-preserve-window-point
;; point.
(switch-to-buffer-preserve-window-point
(if dired-auto-revert-buffer
nil
switch-to-buffer-preserve-window-point)))
(find-file (dired-get-file-for-visit))))
(defun dired-find-alternate-file ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment