Change flyspell-start behavior
This commit is contained in:
parent
8fd98de300
commit
1ac673c763
8
init.el
8
init.el
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue