21.6.1 How 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 Displaying a Buffer in The Emacs Lisp Reference Manual, for details about how to alter this sequence of steps.