return window;
}
+/* Deiconify the frame containing the window WINDOW, then return WINDOW. */
+
+static Lisp_Object
+display_buffer_1 (window)
+ Lisp_Object window;
+{
+#ifdef MULTI_FRAME
+ FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
+ FRAME_SAMPLE_VISIBILITY (f);
+ if (FRAME_ICONIFIED_P (f))
+ Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
+#endif
+ return window;
+}
+
DEFUN ("display-buffer", Fdisplay_buffer, Sdisplay_buffer, 1, 2,
"bDisplay buffer: \nP",
"Make BUFFER appear in some window but don't select it.\n\
if (NILP (not_this_window)
&& XBUFFER (XWINDOW (selected_window)->buffer) == XBUFFER (buffer))
- return selected_window;
+ return display_buffer_1 (selected_window);
/* See if the user has specified this buffer should appear
in the selected window. */
if (!NILP (tem))
{
Fswitch_to_buffer (buffer, Qnil);
- return selected_window;
+ return display_buffer_1 (selected_window);
}
tem = Fassoc (XBUFFER (buffer)->name, Vsame_window_buffer_names);
if (!NILP (tem))
{
Fswitch_to_buffer (buffer, Qnil);
- return selected_window;
+ return display_buffer_1 (selected_window);
}
for (tem = Vsame_window_regexps; CONSP (tem); tem = XCONS (tem)->cdr)
&& fast_string_match (car, XBUFFER (buffer)->name) >= 0)
{
Fswitch_to_buffer (buffer, Qnil);
- return selected_window;
+ return display_buffer_1 (selected_window);
}
else if (CONSP (car)
&& STRINGP (XCONS (car)->car)
XBUFFER (buffer)->name) >= 0)
{
Fswitch_to_buffer (buffer, Qnil);
- return selected_window;
+ return display_buffer_1 (selected_window);
}
}
}
if (!NILP (window)
&& (NILP (not_this_window) || !EQ (window, selected_window)))
{
-#ifdef MULTI_FRAME
- if (FRAME_ICONIFIED_P (XFRAME (WINDOW_FRAME (XWINDOW (window)))))
- Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
-#endif
- return window;
+ return display_buffer_1 (window);
}
/* Certain buffer names get special handling. */
{
window = Fframe_selected_window (call0 (Vpop_up_frame_function));
Fset_window_buffer (window, buffer);
- return window;
+ return display_buffer_1 (window);
}
#endif /* MULTI_FRAME */
window = Fget_lru_window (Qnil);
Fset_window_buffer (window, buffer);
- return window;
+ return display_buffer_1 (window);
}
void