4.1.3 Quitting Windows
q
(magit-mode-bury-buffer
)
This command buries the current Magit buffer.
With a prefix argument, it instead kills the buffer. With a double prefix argument, also kills all other Magit buffers associated with the current project.
user option
magit-bury-buffer-function
The function used to actually bury or kill the current buffer.
magit-mode-bury-buffer
calls this function with one argument. If the argument is non-nil, then the function has to kill the current buffer. Otherwise it has to bury it alive. The default value currently is magit-restore-window-configuration
.
function
magit-restore-window-configuration kill-buffer
Bury or kill the current buffer using quit-window
, which is called with KILL-BUFFER as first and the selected window as second argument.
Then restore the window configuration that existed right before the current buffer was displayed in the selected frame. Unfortunately that also means that point gets adjusted in all the buffers, which are being displayed in the selected frame.
function
magit-mode-quit-window kill-buffer
Bury or kill the current buffer using quit-window
, which is called with KILL-BUFFER as first and the selected window as second argument.
Then, if the window was originally created to display a Magit buffer and the buried buffer was the last remaining Magit buffer that was ever displayed in the window, then that is deleted.