bug#47414: 26.1; [PATCH] compilation-goto-locus does not handle right display-buffer
I noticed that
1. if you apply a custom rule to display-buffer-alist for grep,
occur or compilation buffers that automatically select its
window when the buffer if displayed ;
2. call next-error or previous-error from an error-buffer,
3. compilation-goto-locus will call display-buffer for the
4. the selected-window have now changed, we are in the
compilation window, and nonetheless compilation-goto-locus will
call switch-to-buffer in this window instead of pop-to-buffer.
This patch is a trivial check aknowledge if we are in the
compilation window before choosing what display function to use,
so users can customize the behavior of compilation windows via
display-buffer-alist without breaking the error navigation
In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
of 2021-01-31, modified by Debian built on x86-csail-01
Windowing system distributor 'The X.Org Foundation', version
System Description: Debian GNU/Linux 10 (buster)
Checking 70 files in /usr/share/emacs/26.1/lisp/erc...
Checking 34 files in /usr/share/emacs/26.1/lisp/emulation...
Checking 176 files in /usr/share/emacs/26.1/lisp/emacs-lisp...
Checking 24 files in /usr/share/emacs/26.1/lisp/cedet...
Checking 57 files in /usr/share/emacs/26.1/lisp/calendar...
Checking 87 files in /usr/share/emacs/26.1/lisp/calc...
Checking 105 files in /usr/share/emacs/26.1/lisp/obsolete...
Checking for load-path shadows...done
Message modified; kill anyway? (y or n) y
<select> is undefined
Minor modes in effect:
> This patch is a trivial check aknowledge if we are in the compilation
> window before choosing what display function to use, so users can
> customize the behavior of compilation windows via display-buffer-alist
> without breaking the error navigation functionnalities.
Thanks; applied to Emacs 28.
I'm not 100% confident here, though, since the logic here is slightly
convoluted, but if I read the code correctly, then this shouldn't
introduce any regressions, at least.