diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index affa28c920..504a74dfd1 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2803,12 +2803,13 @@ Window History @section Window History @cindex window history -Each window remembers in a list the buffers it has previously displayed, -and the order in which these buffers were removed from it. This history -is used, for example, by @code{replace-buffer-in-windows} -(@pxref{Buffers and Windows}). The list is automatically maintained by -Emacs, but you can use the following functions to explicitly inspect or -alter it: +Each window remembers in a list the buffers it has previously +displayed, and the order in which these buffers were removed from it. +This history is used, for example, by @code{replace-buffer-in-windows} +(@pxref{Buffers and Windows}), and when quitting windows +(@pxref{Quitting Windows}). The list is automatically maintained by +Emacs, but you can use the following functions to explicitly inspect +or alter it: @defun window-prev-buffers &optional window This function returns a list specifying the previous contents of @@ -2998,15 +2999,17 @@ Quitting Windows before its buffer was displayed in it. The optional argument @var{window} must be a live window and defaults to the selected one. -If @var{window} was created specially for displaying its buffer, this -function deletes @var{window} provided its frame contains at least one -other live window. If @var{window} is the only window on its frame and -there are other frames on the frame's terminal, the value of the -optional argument @var{bury-or-kill} determines how to proceed with the -window. If @var{bury-or-kill} equals @code{kill}, the frame is deleted -unconditionally. Otherwise, the fate of the frame is determined by -calling @code{frame-auto-hide-function} (see below) with that frame as -sole argument. +If @var{window} was previously used for displaying other buffers +(@pxref{Window History}), the most recent buffer in that history will +be displayed. If it has no history, this function deletes +@var{window} altogether, provided its frame contains at least one +other live window. If @var{window} is the only window on its frame +and there are other frames on the frame's terminal, the value of the +optional argument @var{bury-or-kill} determines how to proceed with +the window. If @var{bury-or-kill} equals @code{kill}, the frame is +deleted unconditionally. Otherwise, the fate of the frame is +determined by calling @code{frame-auto-hide-function} (see below) with +that frame as sole argument. Otherwise, this function tries to redisplay the buffer previously shown in @var{window}. It also tries to restore the window start @@ -4857,8 +4860,9 @@ Window Parameters window when it deletes the window passed to it as argument. The fourth element is the buffer whose display caused the creation of -this parameter. @code{quit-restore-window} deletes the specified window -only if it still shows that buffer. +this parameter. @code{quit-restore-window} deletes the specified +window only if it still shows that buffer, and it has no history of +previously-displayed buffers. @item @code{window-side} @code{window-slot} These parameters are used for implementing side windows (@pxref{Side