From 447a3818e966c734a55dbe9ac248d20fb30b074d Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Thu, 8 Aug 2013 13:27:18 -0400 Subject: [PATCH] [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. --- .emacs.d/init.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index a005fec..397c55d 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -19,6 +19,19 @@ (require 'auto-complete-config) (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 (global-set-key (kbd "M-x") 'smex) (global-set-key (kbd "M-X") 'smex-major-mode-commands)