summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2017-04-27 22:26:30 -0400
committerKyle Meyer <kyle@kyleam.com>2017-04-27 22:26:30 -0400
commit18ad99407b7897a48364d7a0426e66746beea426 (patch)
tree3aed1e58ad0f64f0057c82783bd950e1bd28b523
parenta44d0e3874cb157a54feca72e939f1ae0b66cda9 (diff)
downloademacs.d-18ad99407b7897a48364d7a0426e66746beea426.tar.gz
view-mode: Rewrite and move hook for disabling lispy
Directly test for lispy-mode rather than assuming which modes have enabled lispy. Move the hook under into View mode's setup to avoid the 'after' wrapper.
-rw-r--r--init.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/init.el b/init.el
index 1b545e5..8d1ba17 100644
--- a/init.el
+++ b/init.el
@@ -671,6 +671,15 @@
:init
(define-key ctl-x-4-map "v" #'view-file-other-window)
:config
+ (add-hook 'view-mode-hook
+ (lambda ()
+ (when (and view-mode (bound-and-true-p lispy-mode))
+ (lispy-mode -1)
+ (add-hook 'view-mode-hook
+ (lambda ()
+ (unless view-mode (lispy-mode 1)))
+ nil 'local))))
+
(bind-keys :map view-mode-map
("l" . recenter-top-bottom)
("f" . forward-word)
@@ -1904,13 +1913,7 @@
;; `imenu-create-index-function' from being set to
;; `semantic-create-imenu-index'. Trying to set it in
;; `emacs-lisp-mode-hook' or `lispy-mode-hook' doesn't work.
- (defalias 'semantic-create-imenu-index 'imenu-default-create-index-function)
-
- (after 'view
- (add-hook 'view-mode-hook
- (lambda ()
- (when (derived-mode-p 'emacs-lisp-mode 'scheme-mode)
- (funcall #'lispy-mode (if view-mode -1 1)))))))
+ (defalias 'semantic-create-imenu-index 'imenu-default-create-index-function))
(use-package geiser
:config