Kill stray magit buffers

This commit is contained in:
Joseph Ferano 2022-08-25 15:21:35 +07:00
parent f6a6c8513b
commit 62925d18f7

View File

@ -787,10 +787,19 @@ Emacs is an great operating system, if only it had a good text editor...
** Magit ** Magit
The best git porcelain/client I've ever used The best git porcelain/client I've ever used. Also kill stray magit buffers left over as explained [[https://manueluberti.eu/emacs/2018/02/17/magit-bury-buffer/][here]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
(straight-use-package 'magit) (straight-use-package 'magit)
(defun joe/magit-kill-buffers (param)
"Restore window configuration and kill all Magit buffers."
(let ((buffers (magit-mode-get-buffers)))
(magit-restore-window-configuration)
(mapc #'kill-buffer buffers)))
(setq magit-bury-buffer-function #'joe/magit-kill-buffers)
#+end_src #+end_src
** Restclient ** Restclient