Variable: kill-buffer-hook

kill-buffer-hook is a variable defined in files.el.gz.

Value

(preview-kill-buffer-cleanup
 cider-log-kill-buffer-hook-handler
 hywiki-kill-buffer-hook
 tramp-delete-tainted-remote-process-buffer-function
 reftex-kill-buffer-hook
 tramp-flush-file-function
 tramp-delete-temp-file-function
 uniquify-kill-buffer-function
 vc-kill-buffer-hook)

Documentation

Hook run when a buffer is killed.

The buffer being killed is current while the hook is running. See kill-buffer.

This hook is not run for internal or temporary buffers created by get-buffer-create or generate-new-buffer with argument INHIBIT-BUFFER-HOOKS non-nil.

Note: Be careful with let-binding this hook considering it is frequently used for cleanup.

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
;; Defined and used in buffer.c, but not as a DEFVAR_LISP.
(defvar kill-buffer-hook nil
  "Hook run when a buffer is killed.
The buffer being killed is current while the hook is running.
See `kill-buffer'.

This hook is not run for internal or temporary buffers created by
`get-buffer-create' or `generate-new-buffer' with argument
INHIBIT-BUFFER-HOOKS non-nil.

Note: Be careful with let-binding this hook considering it is
frequently used for cleanup.")