From: pillule Date: Sun, 28 Mar 2021 13:18:26 +0000 (+0200) Subject: compilation-goto-locus does not handle right display-buffer X-Git-Tag: emacs-28.0.90~3112 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8b754ca318cb88d9e5f437ccd919a722d345f13f;p=emacs.git 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 --- 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))