Variable: buffer-quit-function

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.