Variable: window-deletable-functions

window-deletable-functions is a customizable variable defined in window.el.gz.

Value

nil

Documentation

Abnormal hook to decide whether a window may be implicitly deleted.

The value should be a list of functions that take two arguments. The first argument is the window about to be deleted. The second argument if non-nil, means that the window is the only window on its frame and should be deleted together with its frame. If the window is live, its buffer is current when running this hook.

If any of these functions returns nil, the window will not be deleted and another buffer will be shown in it. This hook is run implicitly by the functions quit-restore-window, kill-buffer and bury-buffer. It is not run by delete-window and delete-windows-on. The purpose of this hook is to give its clients a chance to save a window or its frame from deletion because they might still want to use that window or frame for their own purposes.

This variable was added, or its default value changed, in Emacs 31.1.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
;;; Deleting windows.
(defcustom window-deletable-functions nil
  "Abnormal hook to decide whether a window may be implicitly deleted.
The value should be a list of functions that take two arguments.  The
first argument is the window about to be deleted.  The second argument
if non-nil, means that the window is the only window on its frame and
should be deleted together with its frame.  If the window is live, its
buffer is current when running this hook.

If any of these functions returns nil, the window will not be deleted
and another buffer will be shown in it.  This hook is run implicitly by
the functions `quit-restore-window', `kill-buffer' and `bury-buffer'.
It is not run by `delete-window' and `delete-windows-on'.  The purpose
of this hook is to give its clients a chance to save a window or its
frame from deletion because they might still want to use that window or
frame for their own purposes."
  :type 'hook
  :version "31.1"
  :group 'windows)