#include "xterm.h"
#endif
-Lisp_Object Qwindowp, Qwindow_live_p;
+Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
static struct window *decode_window P_ ((Lisp_Object));
DELETE_OTHER_WINDOWS, /* Arg is window not to delete */
DELETE_BUFFER_WINDOWS, /* Arg is buffer */
GET_LARGEST_WINDOW,
- UNSHOW_BUFFER /* Arg is buffer */
+ UNSHOW_BUFFER, /* Arg is buffer */
+ CHECK_ALL_WINDOWS
};
static Lisp_Object
}
}
break;
+
+ /* Check for a window that has a killed buffer. */
+ case CHECK_ALL_WINDOWS:
+ if (! NILP (XWINDOW (w)->buffer)
+ && NILP (XBUFFER (XWINDOW (w)->buffer)->name))
+ abort ();
}
if (EQ (w, last_window))
return best_window;
}
+/* Used for debugging. Abort if any window has a dead buffer. */
+
+check_all_windows ()
+{
+ window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
+}
+
DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0,
"Return the window least recently selected or used for display.\n\
If optional argument FRAME is `visible', search all visible frames.\n\
return Qnil;
}
+DEFUN ("window-configuration-frame", Fwindow_configuration_frame, Swindow_configuration_frame, 1, 1, 0,
+ "Return the frame that CONFIG, a window-configuration object, is about.")
+ (config)
+ Lisp_Object config;
+{
+ register struct save_window_data *data;
+ struct Lisp_Vector *saved_windows;
+
+ if (! WINDOW_CONFIGURATIONP (config))
+ wrong_type_argument (Qwindow_configuration_p, config);
+
+ data = (struct save_window_data *) XVECTOR (config);
+ saved_windows = XVECTOR (data->saved_windows);
+ return XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
+}
+
DEFUN ("set-window-configuration", Fset_window_configuration,
Sset_window_configuration, 1, 1, 0,
"Set the configuration of windows and buffers as specified by CONFIGURATION.\n\
CONFIGURATION must be a value previously returned\n\
-by `current-window-configuration' (which see).")
- (configuration)
+by `current-window-configuration' (which see).\n\
+If CONFIGURATION was made from a frame that is now deleted,\n\
+only frame-independent values can be restored. In this case,\n\
+the return value is nil. Otherwise the value is t.")
+ (configuration)
Lisp_Object configuration;
{
register struct save_window_data *data;
int old_point = -1;
while (!WINDOW_CONFIGURATIONP (configuration))
- {
- configuration = wrong_type_argument (intern ("window-configuration-p"),
- configuration);
- }
+ wrong_type_argument (Qwindow_configuration_p, configuration);
data = (struct save_window_data *) XVECTOR (configuration);
saved_windows = XVECTOR (data->saved_windows);
Vminibuf_scroll_window = data->minibuf_scroll_window;
- return Qnil;
+ return (FRAME_LIVE_P (f) ? Qt : Qnil);
}
/* Mark all windows now on frame as deleted
Qwindowp = intern ("windowp");
staticpro (&Qwindowp);
+ Qwindow_configuration_p = intern ("window-configuration-p");
+ staticpro (&Qwindow_configuration_p);
+
Qwindow_live_p = intern ("window-live-p");
staticpro (&Qwindow_live_p);
defsubr (&Srecenter);
defsubr (&Smove_to_window_line);
defsubr (&Swindow_configuration_p);
+ defsubr (&Swindow_configuration_frame);
defsubr (&Sset_window_configuration);
defsubr (&Scurrent_window_configuration);
defsubr (&Ssave_window_excursion);