/* Nonzero after init_window_once has finished. */
static int window_initialized;
+/* Hook to run when window config changes. */
+Lisp_Object Qwindow_configuration_change_hook;
+Lisp_Object Vwindow_configuration_change_hook;
+
/* Nonzero means scroll commands try to put point
at the same screen height as previously. */
static int scroll_preserve_screen_position;
"Remove WINDOW from the display. Default is selected window.")
(window)
register Lisp_Object window;
+{
+ delete_window (window);
+
+ if (! NILP (Vwindow_configuration_change_hook)
+ && ! NILP (Vrun_hooks))
+ call1 (Vrun_hooks, Qwindow_configuration_change_hook);
+
+ return Qnil;
+}
+
+delete_window (window)
+ register Lisp_Object window;
{
register Lisp_Object tem, parent, sib;
register struct window *p;
/* Mark this window as deleted. */
p->buffer = p->hchild = p->vchild = Qnil;
-
- return Qnil;
}
\f
&& ! NILP (w->parent)
&& height < window_min_height)
{
- Fdelete_window (window);
+ delete_window (window);
return;
}
if (!nodelete && width < window_min_width && !NILP (w->parent))
{
- Fdelete_window (window);
+ delete_window (window);
return;
}
run_hook_with_args_2 (Qwindow_scroll_functions, window,
Fmarker_position (w->start));
+ if (! NILP (Vwindow_configuration_change_hook)
+ && ! NILP (Vrun_hooks))
+ call1 (Vrun_hooks, Qwindow_configuration_change_hook);
+
unbind_to (count, Qnil);
return Qnil;
p->parent = o->parent;
p->buffer = Qt;
- Fset_window_buffer (new, o->buffer);
-
/* Apportion the available frame space among the two new windows */
if (!NILP (horflag))
XSETFASTINT (p->top, XFASTINT (o->top) + size_int);
}
+ Fset_window_buffer (new, o->buffer);
+
return new;
}
\f
{
CHECK_NUMBER (arg, 0);
change_window_height (XINT (arg), !NILP (side));
+
+ if (! NILP (Vwindow_configuration_change_hook))
+ call1 (Vrun_hooks, Qwindow_configuration_change_hook);
+
return Qnil;
}
{
CHECK_NUMBER (arg, 0);
change_window_height (-XINT (arg), !NILP (side));
+
+ if (! NILP (Vwindow_configuration_change_hook))
+ call1 (Vrun_hooks, Qwindow_configuration_change_hook);
+
return Qnil;
}
if (*sizep + delta < MINSIZE (window))
{
- Fdelete_window (window);
+ delete_window (window);
return;
}
Fset_buffer (new_current_buffer);
Vminibuf_scroll_window = data->minibuf_scroll_window;
+
+ if (! NILP (Vwindow_configuration_change_hook)
+ && ! NILP (Vrun_hooks))
+ call1 (Vrun_hooks, Qwindow_configuration_change_hook);
+
return (Qnil);
}
syms_of_window ()
{
+ staticpro (&Qwindow_configuration_change_hook);
+ Qwindow_configuration_change_hook
+ = intern ("window-configuration-change-hook");
+
Qwindowp = intern ("windowp");
staticpro (&Qwindowp);
"*Nonzero means scroll commands move point to keep its screen line unchanged.");
scroll_preserve_screen_position = 0;
+ DEFVAR_LISP ("window-configuration-change-hook",
+ &Vwindow_configuration_change_hook,
+ "Functions to call when window configuration changes.\n\
+The selected frae is the one whose configuration has changed.");
+ Vwindow_configuration_change_hook = Qnil;
+
defsubr (&Sselected_window);
defsubr (&Sminibuffer_window);
defsubr (&Swindow_minibuffer_p);