If I only have one window showing in emacs and use M-x compile, the window splits in two and I can watch the compile buffer easily. However, if I have more windows showing, the compilation log takes over one of the others, which I find irritating. How can I make emacs always split a new window to show the compilation log?
Edit: A bit more information from my reading that I've been doing. It looks like compile.el calls display-buffer, which only splits a window if it is current full width. Is there some way to avoid this behaviour?
You may modify the solution provided by Trey Jackson to fit your needs.
The following snippet marks buffer *compilation*
as special, and sets a customized function as its display function to split current window even if already in a split window.
(setq special-display-buffer-names
'("*compilation*"))
(setq special-display-function
(lambda (buffer &optional args)
(split-window)
(switch-to-buffer buffer)
(get-buffer-window buffer 0)))
If what you're wanting is a dedicated top-level window (Emacs calls these frames), then this will do the trick for you. This snippet includes placement directives, but customizing the 'special-display-buffer-names
variable will get you what you want.
(setq special-display-buffer-names
`(("*compilation*" . ((name . "*compilation*")
,@default-frame-alist
(left . (- 1))
(top . 0)))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With