summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2016-11-06 13:28:02 +0100
committerAlan Pearce2016-11-06 13:28:12 +0100
commit45fcb8ae271a4d01ca59a4181431d94ace7b12dc (patch)
tree649597c7396f8f3fea03a5387897a98edc56cee8
parentd18942af3be0ee634695630e2e0b17a3f12fd815 (diff)
downloadnixfiles-45fcb8ae271a4d01ca59a4181431d94ace7b12dc.tar.lz
nixfiles-45fcb8ae271a4d01ca59a4181431d94ace7b12dc.tar.zst
nixfiles-45fcb8ae271a4d01ca59a4181431d94ace7b12dc.zip
Emacs: Configure ispell checker dynamically
-rw-r--r--tag-emacs/emacs.d/init.org16
1 files changed, 11 insertions, 5 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 4a50fa9e..a01fa1fa 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1956,11 +1956,17 @@ I derived a mode for twig, in order to use its =mode-hook=.
 * Spelling
 
 #+BEGIN_SRC emacs-lisp
-(use-package ispell
-  :bind (("<f8>" . ispell-word))
-  :config (progn
-            (setq ispell-program-name "aspell"
-                  ispell-dictionary "british")))
+  (use-package ispell
+    :bind (("<f8>" . ispell-word))
+    :config (progn
+              (cond
+               ((executable-find "aspell") (setq ispell-program-name "aspell"
+                                                 ispell-dictionary "british"
+                                                 ispell-really-aspell t
+                                                 ispell-really-hunspell nil))
+               ((executable-find "hunspell") (setq ispell-program-name "hunspell"
+                                                   ispell-really-aspell nil
+                                                   ispell-really-hunspell t)))))
 #+END_SRC
 
 * Scripting