Emacs 23.2 opens a new window for each compilation error / warning,

I recently upgraded from Carbon Emacs (v22.3) to Vanilla Emacs 23.2 (from http://www.emacsformacosx.com ). On Carbon Emacs, when compiling a project, the frame is split into two with the current source file / SConscript in the upper window and compilation of the output in the lower window. I pressed Cx ` to go to the first warning or error at the compilation output, and it will replace everything that was in the top window with the source file in which the error or warning is located.

In Emacs 23.2, however, a third window opens, opening two windows in the upper half of the frame (vertical separation) and compilation output in the window of the lower half of the frame. How do I tell Emacs not to open a new window and instead open code in an existing non-compiler output window in a frame?


A bit more clarification about the behavior I just noticed. If I hit Cx ` while the buffer containing the source file or the SConscript file is active, a new window does not open. This is only if I manually go through the * compilation * buffer and click on an error or warning, or by clicking on the warning when a third buffer window appears.

+7
emacs elisp
source share
2 answers

The function that is used in the next-error functionality is pop-to-buffer , which in turn uses split-window-sensibly . You can control the behavior of split-window-sensibly by adjusting the variables split-width-threshold and split-height-threshold .

In your case, this is split-width-threshold , which is too small. My emacs 23.1 is set to 160. Just set it to a larger number and the problem should be resolved:

 (setq split-width-threshold 200) 
+4
source share

I cannot reproduce this problem myself, but you can try the following:

 (setq split-width-threshold nil) 

This tells display-buffer never split the windows horizontally, even if they are quite wide. There is also a variable split-height-threshold , which is handled in a similar way. Checking the current values โ€‹โ€‹of these variables can mean whether they can be related to the behavior you see.

display-buffer-function last thing to check: if you define your own display-buffer-function , this may make these solutions for you.

+2
source share

All Articles