Change flyspell-start behavior

This commit is contained in:
Case Duckworth 2021-05-28 20:50:45 -05:00
parent 8fd98de300
commit 1ac673c763
1 changed files with 3 additions and 5 deletions

View File

@ -390,20 +390,18 @@
(unless (file-exists-p ispell-personal-dictionary)
(write-region "" nil ispell-personal-dictionary nil 0))
(defun flyspell-start (&optional dont-warn-when-unknown-mode)
(defun flyspell-start ()
"Start `flyspell-mode' or `flyspell-prog-mode', depending on current mode."
(interactive)
(cond ((derived-mode-p 'text-mode)
(flyspell-mode))
((derived-mode-p 'prog-mode)
(flyspell-prog-mode))
((not dont-warn-when-unknown-mode) ; god this is ugly
((called-interactively-p)
(message "Non-text or -prog mode. Run `flyspell-mode'."))))
(:global "C-c s" flyspell-start)
(when (acdw/system :home)
(flyspell-start t))
(add-hook 'change-major-mode-hook #'flyspell-start))
(:when-loaded
(setup (:straight flyspell-correct)