buffer-quit-function is a variable defined in `simple.el'.
Its value is
This variable may be risky if used as a file-local variable.
Function to call to "quit" the current buffer, or nil if none.
M-ESC ESC calls this function when its more local actions
(such as canceling a prefix argument, minibuffer or region) do not apply.