Corfuでispellのエラーが出たので対処


init.elの大掃除として、コード補完に Company を利用していたのを、 CorfuCape に乗り換えてみました。

環境はEmacs HEADビルド (31.0.50) です。

その結果、Org Modeでアルファベットを書いていると定期的にエラーが発生し入力が中断されてしまうように。 例えば、 abc と入力してしばらくすると、以下のようなメッセージが出力されます。

Debugger entered--Lisp error: (error "ispell-lookup-words: No plain word-list found at systemdefault locations.  Customize ‘ispell-alternate-dictionary’ to set yours.")
  error("ispell-lookup-words: No plain word-list found at systemdefault locations.  Customize `ispell-alternate-dictionary' to set yours.")
  ispell-lookup-words("abc")
  ispell-completion-at-point()
  corfu--capf-wrapper(ispell-completion-at-point)
  run-hook-wrapped(corfu--capf-wrapper ispell-completion-at-point)
  corfu--auto-complete-deferred((#<window 3 on init.org> #<buffer init.org> 2614 96))
  apply(corfu--auto-complete-deferred (#<window 3 on init.org> #<buffer init.org> 2614 96))
  timer-event-handler([t 26307 8851 745683 nil corfu--auto-complete-deferred ((#<window 3 on init.org> #<buffer init.org> 2614 96)) nil 721000 nil])

ログを見てみると、どうやら自分が自動補完を有効化していたので、 アルファベットを入力すると、 ispell を使って英単語の補完をしようとしているが、 ispell は設定していないので、ispellが動かずにエラーになっているようです。

大本のREADMEにも、 Emacs30移行では ispellの補完は無効にするように記載がありました。

;; Emacs 30 and newer: Disable Ispell completion function. As an alternative,
;; try `cape-dict'.
(text-mode-ispell-word-completion nil)

https://github.com/minad/corfu?tab=readme-ov-file#configuration

ということで、自分の設定にもとりこんでエラーが出なくなったことを確認。よかった。

(leaf corfu
  :ensure t
  :defun
  (global-corfu-mode)
  :config
  (global-corfu-mode)
  :custom
  (corfu-cycle . t)
  (corfu-auto . t)
  (text-mode-ispell-word-completion . nil))

関連記事

comments powered by Disqus