From 78ff92597ef6e9493a4f06cd9bb5eb4fd1faff5f Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 13 Sep 2018 00:47:03 +0300 Subject: [PATCH] * lisp/simple.el (next-error-no-select): Set display-buffer-overriding-action to display-buffer-reuse-window (bug#32607). --- lisp/simple.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/simple.el b/lisp/simple.el index 0ccf2f1d22e..ffd7fcc067a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -385,7 +385,11 @@ select the source buffer." (interactive "p") (let ((next-error-highlight next-error-highlight-no-select)) (next-error n)) - (pop-to-buffer next-error-last-buffer)) + (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))) (defun previous-error-no-select (&optional n) "Move point to the previous error in the `next-error' buffer and highlight match. -- 2.39.2