summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2018-07-12 15:46:51 +0200
committerAlan Pearce2018-07-12 15:46:51 +0200
commit54d8b5a25eca51f9728ff21f104d014e160ca6d6 (patch)
treef2c9e7f027cf92e51356b79b2a4652254607e727
parent1f90c4a4569379b5a490e35140694cbbe849d5ca (diff)
downloaddotfiles-54d8b5a25eca51f9728ff21f104d014e160ca6d6.tar.lz
dotfiles-54d8b5a25eca51f9728ff21f104d014e160ca6d6.tar.zst
dotfiles-54d8b5a25eca51f9728ff21f104d014e160ca6d6.zip
Emacs: load sentence-navigation with care
-rw-r--r--emacs/.emacs.d/main.el16
1 files changed, 8 insertions, 8 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 492b417..421f74a 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -2554,14 +2554,14 @@ Pass ARG to `comint-delchar-or-maybe-eof'."
             (evil-space-mode +1)))
 
 (use-package sentence-navigation
-  :if evil-mode
-  :config (progn
-            (define-key evil-motion-state-map ")" 'sentence-nav-evil-forward)
-            (define-key evil-motion-state-map "(" 'sentence-nav-evil-backward)
-            (define-key evil-motion-state-map "g)" 'sentence-nav-evil-forward-end)
-            (define-key evil-motion-state-map "g(" 'sentence-nav-evil-backward-end)
-            (define-key evil-outer-text-objects-map "s" 'sentence-nav-evil-a-sentence)
-            (define-key evil-inner-text-objects-map "s" 'sentence-nav-evil-inner-sentence)))
+  :if (and evil-mode (boundp 'sentence-nav-evil-forward))
+  :config (progn
+            (define-key evil-motion-state-map ")" #'sentence-nav-evil-forward)
+            (define-key evil-motion-state-map "(" #'sentence-nav-evil-backward)
+            (define-key evil-motion-state-map "g)" #'sentence-nav-evil-forward-end)
+            (define-key evil-motion-state-map "g(" #'sentence-nav-evil-backward-end)
+            (define-key evil-outer-text-objects-map "s" #'sentence-nav-evil-a-sentence)
+            (define-key evil-inner-text-objects-map "s" #'sentence-nav-evil-inner-sentence)))
 
 ;;;; End