if (NILP (buffer))
{
XSETBUFFER (buffer, current_buffer);
-
- /* If we're burying the current buffer, unshow it. */
- Fswitch_to_buffer (Fother_buffer (buffer, Qnil), Qnil);
}
else
{
buffer = buf1;
}
+ /* Unshow the buffer in the selected window, if it is there. */
+ if (EQ (XWINDOW (selected_window)->buffer, buffer))
+ Fswitch_to_buffer (Fother_buffer (buffer, Qnil), Qnil);
+ /* Otherwise, unshow it in other frames. */
+ else
+ Freplace_buffer_in_windows (buffer);
+
/* Move buffer to the end of the buffer list. */
{
register Lisp_Object aelt, link;