Function: window-old-buffer
window-old-buffer is a function defined in window.c.
Signature
(window-old-buffer &optional WINDOW)
Documentation
Return the old buffer displayed by WINDOW.
WINDOW must be a live window and defaults to the selected one.
The return value is the buffer shown in WINDOW at the last time window change functions were run. It is nil if WINDOW was created after that. It is t if WINDOW has been restored from a window configuration after that.
Probably introduced at or before Emacs version 27.1.
Source Code
// Defined in /usr/src/emacs/src/window.c
{
struct window *w = decode_live_window (window);
return (NILP (w->old_buffer)
/* A new window. */
? Qnil
: (w->change_stamp != WINDOW_XFRAME (w)->change_stamp)
/* A window restored from a configuration. */
? Qt
/* A window that was live the last time seen by window
change functions. */
: w->old_buffer);
}