From b52d2b2dd06a563e6f56aa2e36cb6e8c011b7061 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 19 Mar 2024 21:41:50 -0400 Subject: [PATCH] fix(corfu): ispell: only complain once per session --- modules/completion/corfu/config.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index 06dcd83cd..d6948c90a 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -83,7 +83,21 @@ use the minibuffer such as `query-replace'.") (when (member (bound-and-true-p evil--ex-search-update-timer) timer-idle-list) (apply (timer--function evil--ex-search-update-timer) - (timer--args evil--ex-search-update-timer)))))) + (timer--args evil--ex-search-update-timer))))) + + ;; HACK: If your dictionaries aren't set up in text-mode buffers, ispell will + ;; continuously pester you about errors. This ensures it only happens once + ;; per session. + (defadvice! +corfu--auto-disable-ispell-capf-a (fn &rest args) + "If ispell isn't properly set up, only complain once per session." + :around #'ispell-completion-at-point + (condition-case-unless-debug e + (apply fn args) + ('error + (message "Error: %s" (error-message-string e)) + (message "Auto-disabling `text-mode-ispell-word-completion'") + (setq text-mode-ispell-word-completion nil) + (remove-hook 'completion-at-point-functions #'ispell-completion-at-point t))))) (use-package! cape :defer t