Skip to content

Instantly share code, notes, and snippets.

@julienXX
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienXX/e57e3fbe030399e34554 to your computer and use it in GitHub Desktop.
Save julienXX/e57e3fbe030399e34554 to your computer and use it in GitHub Desktop.
(require 'cl)
(defun is-magit-buffer (buffer)
(let ((name (buffer-name buffer)))
(and (= ?* (aref name 0))
(not (string-match "^\\*magit\\*" name)))))
(defun kill-magit-buffers ()
(interactive)
(loop for buffer being the buffers
do (and (is-magit-buffer buffer) (kill-buffer buffer))))
;; Plus something like this
(add-hook 'magit-quit-session 'kill-magit-buffers)
@julienXX
Copy link
Author

Might need some tuning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment