d12frosted / flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Other
203 stars 14 forks source link

Correcting words with `flyspell-mode` disabled? #106

Open ghost opened 1 year ago

ghost commented 1 year ago

Hi!

Thanks for this package! I really enjoy it.

Occasionally I need spell-checking without flyspell-mode. In that case I would use ispell-word. However, I really like the interface of this package and want to use it as a replacement of ispell-word.

I wonder if it is a reasonable goal of this project to provide and maintain some commands that work without flyspell-mode?

Thanks!

PS: Currently flyspell-correct-at-point mostly works without flyspell-mode. However, we need to initialize the spell-checker properly:

diff --git a/flyspell-correct.el b/flyspell-correct.el
index c661340..2992d89 100644
--- a/flyspell-correct.el
+++ b/flyspell-correct.el
@@ -224,6 +224,7 @@ Adapted from `flyspell-correct-word-before-point'."
   (unless flyspell-correct-interface
     (error "Could not correct word because `flyspell-correct-interface' is not set"))
   (let ((res))
+    (ispell-set-spellchecker-params)
     ;; use the correct dictionary
     (flyspell-accept-buffer-local-defs)
     (flyspell-correct--highlight-add)

Besides, flyspell-correct-highlight does not work.

Other public commands probably do not work because they need the overlays of flyspell-mode.