From 8b754ca318cb88d9e5f437ccd919a722d345f13f Mon Sep 17 00:00:00 2001 From: pillule Date: Sun, 28 Mar 2021 15:18:26 +0200 Subject: [PATCH] compilation-goto-locus does not handle right display-buffer * lisp/progmodes/compile.el (compilation-goto-locus): Pop to the source buffer if the match buffer is the selected window (bug#47414). Copyright-paperwork-exempt: yes --- lisp/progmodes/compile.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d23c77ef860..7a02c3a896f 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2844,8 +2844,9 @@ and overlay is highlighted between MK and END-MK." (when (and (not pre-existing) w) (compilation-set-window-height w)) - (if from-compilation-buffer - ;; If the compilation buffer window was selected, + (if (or from-compilation-buffer + (eq w (selected-window))) + ;; If the compilation buffer window is selected, ;; keep the compilation buffer in this window; ;; display the source in another window. (let ((pop-up-windows t)) -- 2.39.2