From 5df4ba0e75d0474c43531af4c0e4c55b0e07198e Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sat, 27 Jun 2015 10:44:30 +0200 Subject: [PATCH] Implement fullscreen magit status without advices --- contrib/!source-control/git/extensions.el | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/contrib/!source-control/git/extensions.el b/contrib/!source-control/git/extensions.el index 557a5a394..eff7ac151 100644 --- a/contrib/!source-control/git/extensions.el +++ b/contrib/!source-control/git/extensions.el @@ -87,17 +87,11 @@ ;; full screen magit-status (when git-magit-status-fullscreen - (defadvice magit-status (around magit-fullscreen activate) - (window-configuration-to-register :magit-fullscreen) - ad-do-it - (delete-other-windows)) - - (defun magit-quit-session () - "Restores the previous window configuration and kills the magit buffer" - (interactive) - (kill-buffer) - (jump-to-register :magit-fullscreen)) - (define-key magit-status-mode-map (kbd "q") 'magit-quit-session)) + (setq magit-restore-window-configuration t) + (setq magit-status-buffer-switch-function + (lambda (buffer) + (pop-to-buffer buffer) + (delete-other-windows)))) (defun magit-toggle-whitespace () (interactive)