aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStephen Berman2017-07-29 13:34:47 +0200
committerStephen Berman2017-07-29 13:34:47 +0200
commit8e394b082bd6ecd9ba212cb3ca07cbace66767a6 (patch)
tree4782f5d9fb8b3143acd57ccf9de78f633c6c94f6 /lisp
parentdfee60fe66f3d9fe4249c9662d802753f3e50929 (diff)
downloademacs-8e394b082bd6ecd9ba212cb3ca07cbace66767a6.tar.gz
emacs-8e394b082bd6ecd9ba212cb3ca07cbace66767a6.zip
Preserve point under 'dired-auto-revert-buffer' (third case)
* lisp/files.el (find-file): Use pop-to-buffer-same-window instead of switch-to-buffer. This preserves Dired window point when dired-auto-revert-buffer is non-nil. (Bug#27243) * test/lisp/dired-tests.el (dired-test-bug27243-01) (dired-test-bug27243-02, dired-test-bug27243-03): New tests. The first two replace a previous test that combined them; that test intermittently fails in the Hydra build system, so maybe separating the two cases will help locate the point of failure. The third test involves find-file but is here because it, like the others, is testing the effect of dired-auto-revert-buffer.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 6d9957d494a..6ce2fe98b05 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1599,8 +1599,8 @@ automatically choosing a major mode, use \\[find-file-literally]."
1599 (confirm-nonexistent-file-or-buffer))) 1599 (confirm-nonexistent-file-or-buffer)))
1600 (let ((value (find-file-noselect filename nil nil wildcards))) 1600 (let ((value (find-file-noselect filename nil nil wildcards)))
1601 (if (listp value) 1601 (if (listp value)
1602 (mapcar 'switch-to-buffer (nreverse value)) 1602 (mapcar 'pop-to-buffer-same-window (nreverse value))
1603 (switch-to-buffer value)))) 1603 (pop-to-buffer-same-window value))))
1604 1604
1605(defun find-file-other-window (filename &optional wildcards) 1605(defun find-file-other-window (filename &optional wildcards)
1606 "Edit file FILENAME, in another window. 1606 "Edit file FILENAME, in another window.