summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-06-28 00:26:48 -0400
committerKyle Meyer <kyle@kyleam.com>2015-06-28 00:26:48 -0400
commit037bae68d5ca6e6e9783c41e4102704b50f1bf62 (patch)
tree838dbaec9f37603b42d773b659de10f51ad6b09a /lisp
parente1a67b3941863f47ff57040334c6f737e6429165 (diff)
downloademacs.d-037bae68d5ca6e6e9783c41e4102704b50f1bf62.tar.gz
init-god.el: Use predicate for Magit modes
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-god.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/init-god.el b/lisp/init-god.el
index 4f3acf7..04c9a8c 100644
--- a/lisp/init-god.el
+++ b/lisp/init-god.el
@@ -4,17 +4,11 @@
'(gnus-group-mode
gnus-summary-mode
gnus-article-mode
- message-mode
- magit-popup-mode
- magit-popup-sequence-mode))
+ message-mode))
(setq god-exempt-major-modes
(append km/god-exempt-major-modes god-exempt-major-modes))
-;; `god-exempt-major-modes' can't be used here because buffer is in
-;; `text mode'.
-(add-hook 'git-commit-setup-hook (lambda () (god-local-mode -1)))
-
(add-hook 'view-mode-hook (lambda ()
(if view-mode
(god-local-mode-pause)
@@ -38,6 +32,12 @@
(defun km/god-update-cursor ()
(setq cursor-type (if god-local-mode 'bar 'box)))
+(defun km/god-magit-mode-p ()
+ "Return non-nil if a Magit-related mode is enabled."
+ (or global-git-commit-mode
+ (god-mode-child-of-p major-mode 'magit-popup-mode)
+ (god-mode-child-of-p major-mode 'magit-mode)))
+
(global-set-key (kbd "C-c d") 'god-local-mode)
(define-key god-local-mode-map "." 'repeat)