Function: pop-to-buffer-same-window

Select buffer BUFFER in some window, preferably the same one.
This function behaves much like `switch-to-buffer', except it
displays with `special-display-function' if BUFFER has a match in
`special-display-buffer-names' or `special-display-regexps'.

Unlike `pop-to-buffer', this function prefers using the selected
window over popping up a new window or frame.

BUFFER may be a buffer, a string (a buffer name), or nil. If it
is a string not naming an existent buffer, create a buffer with
that name. If BUFFER is nil, choose some other buffer. Return
the buffer.

NORECORD, if non-nil means do not put this buffer at the front of the list of recently selected ones.