From 4bb775412408e36d465d4401af8a85355bb4c3cd Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Tue, 23 Dec 2014 00:16:06 -0500 Subject: Add command magit-mode-quit-all-windows --- lisp/init-git.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp') diff --git a/lisp/init-git.el b/lisp/init-git.el index ef6b13a..9de3546 100644 --- a/lisp/init-git.el +++ b/lisp/init-git.el @@ -127,6 +127,12 @@ START-POINT set to the current branch. (magit-run-git "branch" (concat "b/" it)) (user-error "No current branch"))) +(defun km/magit-mode-quit-all-windows (&optional kill-buffer) + "Run `magit-mode-quit-window' until no longer in Magit buffer." + (interactive "P") + (while (derived-mode-p 'magit-mode) + (magit-mode-quit-window kill-buffer))) + ;; http://whattheemacsd.com/setup-magit.el-01.html (defadvice magit-status-internal (around magit-fullscreen activate) ad-do-it @@ -151,6 +157,8 @@ START-POINT set to the current branch. (remove-hook 'magit-refs-sections-hook 'magit-insert-tags) + (define-key magit-mode-map "Q" 'km/magit-mode-quit-all-windows) + (define-key magit-popup-mode-map (kbd "SPC ") 'magit-invoke-popup-switch) (define-key magit-popup-mode-map (kbd "SPC SPC ") 'magit-invoke-popup-option) -- cgit v1.2.3