doomemacs/modules/feature/spellcheck/config.el

30 lines
964 B
EmacsLisp
Raw Normal View History

;;; feature/spellcheck/config.el -*- lexical-binding: t; -*-
2017-02-13 18:51:29 +08:00
(def-package! flyspell ; built-in
2017-02-13 18:51:29 +08:00
:commands flyspell-mode
2017-02-20 07:32:26 +08:00
:config
(setq ispell-program-name (executable-find "aspell")
ispell-list-command "--list"
ispell-extr-args '("--dont-tex-check-comments"))
(defun +spellcheck|automatically ()
"Spellcheck the buffer when `flyspell-mode' is enabled."
(when flyspell-mode
(flyspell-buffer)))
(add-hook 'flyspell-mode-hook #'+spellcheck|automatically))
2017-02-13 18:51:29 +08:00
(def-package! flyspell-correct
2017-02-13 18:51:29 +08:00
:commands (flyspell-correct-word-generic
flyspell-correct-previous-word-generic)
2017-02-13 18:51:29 +08:00
:config
(cond ((featurep! :completion helm)
(require 'flyspell-correct-helm))
((featurep! :completion ivy)
(require 'flyspell-correct-ivy))
(t
(require 'flyspell-correct-popup)
(setq flyspell-popup-correct-delay 0.8)
(define-key popup-menu-keymap [escape] #'keyboard-quit))))