[emacs] full-screen magit status

Advises the magit buffer to open full-screened, and restore the
original window configuration when magit is quit.

Based on the post http://whattheemacsd.com/setup-magit.el-01.html and
ideas from the comments there.
This commit is contained in:
Correl Roush 2013-08-08 13:27:18 -04:00
parent 90b572a6b8
commit 447a3818e9

View file

@ -19,6 +19,19 @@
(require 'auto-complete-config) (require 'auto-complete-config)
(ac-config-default) (ac-config-default)
;; Magit
(defun magit-fullscreen ()
(defadvice magit-status (around magit-fullscreen activate)
(window-configuration-to-register :magit-fullscreen)
ad-do-it
(delete-other-windows))
(defadvice magit-quit-window (around magit-restore-screen activate)
ad-do-it
(jump-to-register :magit-fullscreen)))
(eval-after-load 'magit '(magit-fullscreen))
;; Smex ;; Smex
(global-set-key (kbd "M-x") 'smex) (global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands) (global-set-key (kbd "M-X") 'smex-major-mode-commands)