diff --git a/modules/checkers/spell/autoload/+spell-fu.el b/modules/checkers/spell/autoload/+spell-fu.el index cf65b39fe..25a0a1063 100644 --- a/modules/checkers/spell/autoload/+spell-fu.el +++ b/modules/checkers/spell/autoload/+spell-fu.el @@ -57,12 +57,6 @@ or (and ispell-really-aspell ispell-program-name) (executable-find "aspell")) (user-error "Aspell is required for spell checking")) - ;; HACK When spell-fu fails to initialize correctly, the init form for the - ;; spell-fu use-package! is not called. This leaves emacs to assume that - ;; certain variables are initialized when they are not. We bind what we - ;; need. - (unless (boundp '+spell-correct-interface) - (+spell-defun-correct-interface)) (ispell-set-spellchecker-params) (save-current-buffer diff --git a/modules/checkers/spell/config.el b/modules/checkers/spell/config.el index 68273c8f3..b28bc4b05 100644 --- a/modules/checkers/spell/config.el +++ b/modules/checkers/spell/config.el @@ -70,21 +70,20 @@ (eval-if! (not (featurep! +flyspell)) - (defun +spell-defun-correct-interface () + (use-package! spell-fu + :when (executable-find "aspell") + :hook (text-mode . spell-fu-mode) + :general ([remap ispell-word] #'+spell/correct) + :preface (defvar +spell-correct-interface (cond ((featurep! :completion ivy) #'+spell-correct-ivy-fn) ((featurep! :completion helm) #'+spell-correct-helm-fn) (#'+spell-correct-generic-fn)) - "Function to use to display corrections.")) + "Function to use to display corrections.") - (use-package! spell-fu - :when (executable-find "aspell") - :hook (text-mode . spell-fu-mode) - :general ([remap ispell-word] #'+spell/correct) :init - (+spell-defun-correct-interface) (defvar +spell-excluded-faces-alist '((markdown-mode . (markdown-code-face