diff options
author | Case Duckworth | 2021-05-28 20:50:45 -0500 |
---|---|---|
committer | Case Duckworth | 2021-05-28 20:50:45 -0500 |
commit | 1ac673c76346abd12136db68280b807d17a5d0cb (patch) | |
tree | c83a51ad5ae8f8a79c684ee8832ec336edc6ce07 | |
parent | Add eshell last argument (diff) | |
download | emacs-1ac673c76346abd12136db68280b807d17a5d0cb.tar.gz emacs-1ac673c76346abd12136db68280b807d17a5d0cb.zip |
Change flyspell-start behavior
-rw-r--r-- | init.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/init.el b/init.el index 8d18dd9..359c188 100644 --- a/init.el +++ b/init.el | |||
@@ -390,20 +390,18 @@ | |||
390 | (unless (file-exists-p ispell-personal-dictionary) | 390 | (unless (file-exists-p ispell-personal-dictionary) |
391 | (write-region "" nil ispell-personal-dictionary nil 0)) | 391 | (write-region "" nil ispell-personal-dictionary nil 0)) |
392 | 392 | ||
393 | (defun flyspell-start (&optional dont-warn-when-unknown-mode) | 393 | (defun flyspell-start () |
394 | "Start `flyspell-mode' or `flyspell-prog-mode', depending on current mode." | 394 | "Start `flyspell-mode' or `flyspell-prog-mode', depending on current mode." |
395 | (interactive) | 395 | (interactive) |
396 | (cond ((derived-mode-p 'text-mode) | 396 | (cond ((derived-mode-p 'text-mode) |
397 | (flyspell-mode)) | 397 | (flyspell-mode)) |
398 | ((derived-mode-p 'prog-mode) | 398 | ((derived-mode-p 'prog-mode) |
399 | (flyspell-prog-mode)) | 399 | (flyspell-prog-mode)) |
400 | ((not dont-warn-when-unknown-mode) ; god this is ugly | 400 | ((called-interactively-p) |
401 | (message "Non-text or -prog mode. Run `flyspell-mode'.")))) | 401 | (message "Non-text or -prog mode. Run `flyspell-mode'.")))) |
402 | 402 | ||
403 | (:global "C-c s" flyspell-start) | ||
404 | |||
405 | (when (acdw/system :home) | 403 | (when (acdw/system :home) |
406 | (flyspell-start t)) | 404 | (add-hook 'change-major-mode-hook #'flyspell-start)) |
407 | 405 | ||
408 | (:when-loaded | 406 | (:when-loaded |
409 | (setup (:straight flyspell-correct) | 407 | (setup (:straight flyspell-correct) |