I work with different Emacs frames on the same desktop. When I run compile
Emacs splits the current frame and creates a clone of the buffer *compilation*
, although the compilation buffer is already visible, but just in another frame. After that I see the same compilation buffer in both frames. I am wondering, why this is the default, because it does not seem to make any sense.
The following video shows this: https://youtu.be/hvziEkfmb_c
I have read that display-buffer-alist
is the right place to customize this feature, but I do not understand the condition and action arguments.
I would like to give each frame a meaning: for example compile frame and edit frame. When I run compile
from the edit frame, Emacs should use the compile frame for the compilation buffer. And when I click on a source line in the compilation buffer in the compile frame, it should use the edit frame to show either the buffer of the already opened file or it should use the edit frame to open the new file.
I general Emacs should never split a frame for a buffer, which is already visible in another frame.
I not sure how this logic fits into the display-buffer-alist
.
*compilation*
window. STEP #1 Start a vanilla Emacs without any user configuration, akaemacs -Q
. STEP #2 We are now at a welcome screen with a buffer named*GNU Emacs*
. STEP #3 TypeM-x compile
and delete the sample compile commandmake -k
and replace that with the worddate
and pressRET
. The window containing*GNU Emacs*
is split horizontally in two and the bottom window now contains the*compilation*
buffer, and focus remains in the*GNU Emacs*
window. STEP #4: Repeat STEP #3 above.