display-buffer
works
The display-buffer
command (as well as commands that call it
internally) chooses a window to display by following the steps given
below. See Choosing a Window for Display, for details about how to alter this
sequence of steps.
same-window-buffer-names
, or adding a matching regular
expression to the list same-window-regexps
. By default, these
variables are nil
, so this step is skipped.
pop-up-frames
(see below) to t
.
pop-up-frames
to a non-nil
value. The special value
graphic-only
means to do this only on graphical displays.
The split can be either vertical or horizontal, depending on the
variables split-height-threshold
and
split-width-threshold
. These variables should have integer
values. If split-height-threshold
is smaller than the selected
window's height, the split puts the new window below. Otherwise, if
split-width-threshold
is smaller than the window's width, the
split puts the new window on the right. If neither condition holds,
Emacs tries to split so that the new window is below—but only if the
window was not split before (to avoid excessive splitting).