From 62925d18f7a2169674d11ec627ca64acd2ea4cf8 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 25 Aug 2022 15:21:35 +0700 Subject: [PATCH] Kill stray magit buffers --- .emacs.bankruptcy/init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.emacs.bankruptcy/init.org b/.emacs.bankruptcy/init.org index 3c07493..03ced49 100644 --- a/.emacs.bankruptcy/init.org +++ b/.emacs.bankruptcy/init.org @@ -787,10 +787,19 @@ Emacs is an great operating system, if only it had a good text editor... ** 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 (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 ** Restclient