Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell emacs to not split the window on M-x compile or elisp compilation error?

Tags:

emacs

elisp

When I perform M-x compile or get an elisp compilation error, my emacs splits the window vertically, and displays the compile output/error message in the new window. I prefer to work with my buffers in a full screen window, because the vertically split window is too narrow for me. Can I tell emacs to not split the window and do a M-x switch-buffer to the compilation/error buffer?

Edit: Trey's suggestion works for compilation. Is there a way to set it for all the commands which split the window? The three I have in mind are elisp compiling, M-x apropos and M-x occur.

like image 984
benhsu Avatar asked Jul 08 '11 02:07

benhsu


1 Answers

Try this:

(setq compilation-window-height 1000)

You could get fancy and actually calculate the number of lines of text in the frame... (/ (frame-pixel-height) (frame-char-height)), but that seems silly.

Io control how Emacs generally displays buffers, you can configure the variable same-window-regexps to match all buffer names, and then all commands that display buffers using display-buffer will use the same window:

(setq same-window-regexps '("."))

See Choosing a Window for more details.

like image 190
Trey Jackson Avatar answered Oct 07 '22 01:10

Trey Jackson