doomemacs/modules/feature/spellcheck/config.el

38 lines
1.2 KiB
EmacsLisp
Raw Normal View History

;;; feature/spellcheck/config.el -*- lexical-binding: t; -*-
2017-02-13 05:51:29 -05:00
(defvar-local +spellcheck-immediately t
"If non-nil, spellcheck the current buffer upon starting `flyspell-mode'.
Since spellchecking can be slow in some buffers, this can be disabled with:
(setq-hook! 'LaTeX-mode-hook +spellcheck-immediately nil)")
(def-package! flyspell ; built-in
:defer t
:init
(add-hook 'flyspell-mode-hook #'+spellcheck|immediately)
2017-02-19 18:32:26 -05:00
:config
(setq ispell-program-name (executable-find "aspell")
ispell-list-command "--list"
ispell-extr-args '("--dont-tex-check-comments"))
(defun +spellcheck|immediately ()
"Spellcheck the buffer when `flyspell-mode' is enabled."
(when (and flyspell-mode +spellcheck-immediately)
(flyspell-buffer))))
2017-02-13 05:51:29 -05:00
(def-package! flyspell-correct
2017-02-13 05:51:29 -05:00
:commands (flyspell-correct-word-generic
flyspell-correct-previous-word-generic)
2017-02-13 05:51:29 -05: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))))