]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (next-error-no-select): Use save-selected-window.
authorJuri Linkov <juri@linkov.net>
Sat, 22 Dec 2018 23:52:25 +0000 (01:52 +0200)
committerJuri Linkov <juri@linkov.net>
Sat, 22 Dec 2018 23:52:25 +0000 (01:52 +0200)
Let-bind display alist of display-buffer-overriding-action to
`(inhibit-same-window . t)'.  (Bug#32607)

lisp/simple.el

index 905477a1420f6ba59b99611bad42bd6b4b958f84..ab4960dc968552d154947c14f72dc40193ca5b5d 100644 (file)
@@ -383,13 +383,11 @@ backwards, if negative).
 Finds and highlights the source line like \\[next-error], but does not
 select the source buffer."
   (interactive "p")
-  (let ((next-error-highlight next-error-highlight-no-select))
-    (next-error n))
-  (let ((display-buffer-overriding-action '(display-buffer-reuse-window)))
-    ;; Override user customization such as display-buffer-same-window
-    ;; and use display-buffer-reuse-window to ensure next-error-last-buffer
-    ;; is displayed somewhere, not necessarily in the same window (bug#32607).
-    (pop-to-buffer next-error-last-buffer)))
+  (save-selected-window
+    (let ((next-error-highlight next-error-highlight-no-select)
+          (display-buffer-overriding-action
+           '(nil (inhibit-same-window . t))))
+      (next-error n))))
 
 (defun previous-error-no-select (&optional n)
   "Move point to the previous error in the `next-error' buffer and highlight match.