From 7058facf9d4c4ab3638b5c6c7c314a70f0b43fbe Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 21 Jul 2019 15:24:07 +0200 Subject: [PATCH] ui/vc-gutter: disable git-gutter in some modes Disabling git-gutter in fundamental-mode theoretically reduces the number of times git-gutter is initialized (because it has to switch to and from fundamental-mode once, sometimes twice, when changing major modes). git-gutter also has trouble with org-indent-mode, so we disable it there. And it isn't useful in image-mode. --- modules/ui/vc-gutter/config.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/ui/vc-gutter/config.el b/modules/ui/vc-gutter/config.el index 4b99a4f0e..387d8ac5e 100644 --- a/modules/ui/vc-gutter/config.el +++ b/modules/ui/vc-gutter/config.el @@ -50,6 +50,15 @@ is deferred until the file is saved. Respects `git-gutter:disabled-modes'." (git-gutter-mode +1) (remove-hook 'after-save-hook #'+vc-gutter-init-maybe-h t)))))) + ;; Disable in Org mode, as per + ;; and + ;; . Apparently, the + ;; mode-enabling function for global minor modes gets called for new buffers + ;; while they are still in `fundamental-mode', before a major mode has been + ;; assigned. I don't know why this is the case, but adding `fundamental-mode' + ;; here fixes the issue. + (setq git-gutter:disabled-modes '(fundamental-mode org-mode image-mode)) + ;; standardize default fringe width (if (fboundp 'fringe-mode) (fringe-mode '4)) :config