How do I control whether the output buffer *Compile* of M-x compile will be shown

  • in an existing window or
  • in a new window by splitting an existing window


My problem is that the compilation buffer is opened in an existing window that I want to leave unchanged for other content.

AFAICT, this behaviour is controlled by display-buffer.

1 Answer 1


The command I was looking for was display-buffer-in-direction. My desire use was

(setq display-buffer-alist
      `((,(rx bos
              (| (literal "*compilation")
                 (literal "*shell")
                 (literal "*eshell")
                 (literal "*Compile-Log")))
         (window .                      ;reference window
                 t) ;either `t' (selected window), `main', `root', or an arbitrary valid window
         (direction .
                    below)              ;`below' (window) or `bottom' (of frame)
         (window-height . 0.33)          ;absolute (10) or relative (0.3)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.