summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2020-01-13 12:55:20 -0800
committerFranck Cuny <franck.cuny@gmail.com>2020-01-13 12:55:20 -0800
commit8a7c5ee5991ecd13594711f508980169acaa9a39 (patch)
tree5744a443971a59db07e795fc0a88826b5855fd78 /emacs
parentemacs/go: add binding to run tests. (diff)
downloademacs.d-8a7c5ee5991ecd13594711f508980169acaa9a39.tar.gz
emacs/text: flyspell configuration.
Only use the `flyspell` package if we can find the binary for `aspell`
on the host.

Move a couple of settings from `:config` to `:custom`.

Use `flyspell-correct-ivy`, which is a better UX (for me) than a buffer
at the top of the frame.
Diffstat (limited to '')
-rw-r--r--emacs.d/custom/fcuny-text.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/emacs.d/custom/fcuny-text.el b/emacs.d/custom/fcuny-text.el
index 73f93a4..45198a1 100644
--- a/emacs.d/custom/fcuny-text.el
+++ b/emacs.d/custom/fcuny-text.el
@@ -1,18 +1,19 @@
 (use-package flyspell
+  :ensure t
+  :if (executable-find "aspell")
   :hook ((text-mode . flyspell-mode)
          (prog-mode . flyspell-prog-mode))
+  :custom
+  (ispell-dictionary "en_US")
+  (ispell-program-name "aspell")
   :config
-  (setq ispell-dictionary "en_US")
-
-  (when (executable-find "aspell")
-    (setq ispell-program-name "aspell"))
-
-  (use-package flyspell-correct
-    :after (flyspell)
-    :commands (flyspell-correct-word-generic
-               flyspell-correct-previous-word-generic)
+  (use-package flyspell-correct-ivy
+    :after flyspell
+    :ensure t
     :bind (:map flyspell-mode-map
-                ("C-;" . flyspell-correct-previous-word-generic))))
+                ("C-M-:" . flyspell-correct-at-point))
+    :custom
+    (flyspell-correct-interface #'flyspell-correct-ivy)))
 
 (use-package markdown-mode
   :ensure t