Function: unrecord-window-buffer

unrecord-window-buffer is a byte-compiled function defined in window.el.gz.

Signature

(unrecord-window-buffer &optional WINDOW BUFFER ALL)

Documentation

Unrecord BUFFER in WINDOW.

WINDOW must be a live window and defaults to the selected one. BUFFER must be a live buffer and defaults to the buffer of WINDOW (although that default hardly makes any sense).

Make BUFFER disappear from most components specified by the object of WINDOW. This includes the buffers previously shown in WINDOW as well as any buffers mentioned by WINDOW's quit-restore and quit-restore-prev parameters.

This function is called by replace-buffer-in-windows which is mainly concerned with finding another buffer for all windows showing a buffer about to be killed. It's also called by delete-windows-on and quit-windows-on and should be called wherever the traces of a buffer should be erased from the window handling subsystem.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun unrecord-window-buffer (&optional window buffer all)
  "Unrecord BUFFER in WINDOW.
WINDOW must be a live window and defaults to the selected one.  BUFFER
must be a live buffer and defaults to the buffer of WINDOW (although
that default hardly makes any sense).

Make BUFFER disappear from most components specified by the object of
WINDOW.  This includes the buffers previously shown in WINDOW as well as
any buffers mentioned by WINDOW's `quit-restore' and `quit-restore-prev'
parameters.

This function is called by `replace-buffer-in-windows' which is mainly
concerned with finding another buffer for all windows showing a buffer
about to be killed.  It's also called by `delete-windows-on' and
`quit-windows-on' and should be called wherever the traces of a buffer
should be erased from the window handling subsystem."
  (let* ((window (window-normalize-window window t))
	 (buffer (or buffer (window-buffer window))))
    (when (buffer-live-p buffer)
      (window-discard-buffer-from-window buffer window all))))