summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-06-28 01:27:50 -0400
committerKyle Meyer <kyle@kyleam.com>2015-06-28 01:31:22 -0400
commit93390f910405a1fa69e4e0973b12eaa8f7640976 (patch)
treea9e450a8659554a4234cccf6eb742ce707dc51dd /lisp
parenteb1e92647a13a930abfa36a13abfdd2c34f16f53 (diff)
downloademacs.d-93390f910405a1fa69e4e0973b12eaa8f7640976.tar.gz
init-god.el: Move Gnus check to predicate
Diffstat (limited to 'lisp')
-rw-r--r--lisp/init-god.el17
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/init-god.el b/lisp/init-god.el
index 5233bd5..966a87d 100644
--- a/lisp/init-god.el
+++ b/lisp/init-god.el
@@ -1,15 +1,7 @@
(require 'god-mode)
-(defvar km/god-exempt-major-modes
- '(gnus-group-mode
- gnus-summary-mode
- gnus-article-mode
- message-mode))
-
-(setq god-exempt-major-modes
- (append km/god-exempt-major-modes god-exempt-major-modes))
-
(add-to-list 'god-exempt-predicates #'km/god-magit-mode-p)
+(add-to-list 'god-exempt-predicates #'km/god-gnus-p)
(add-hook 'view-mode-hook (lambda ()
(if view-mode
@@ -40,6 +32,13 @@
(god-mode-child-of-p major-mode 'magit-popup-mode)
(god-mode-child-of-p major-mode 'magit-mode)))
+(defun km/god-gnus-p ()
+ "Return non-nil if a Gnus-related mode is enabled."
+ (derived-mode-p 'gnus-group-mode
+ 'gnus-summary-mode
+ 'gnus-article-mode
+ 'message-mode))
+
(global-set-key (kbd "C-c d") 'god-local-mode)
(define-key god-local-mode-map "." 'repeat)