Function: same-window-p

Return non-nil if a buffer named BUFFER-NAME would be shown in the "same" window.
This function returns non-nil if `display-buffer' or
`pop-to-buffer' would show a buffer named BUFFER-NAME in the
selected rather than (as usual) some other window. See
`same-window-buffer-names' and `same-window-regexps'.