cpitclaudel / alectryon

A collection of tools for writing technical documents that mix Coq code and prose.
MIT License
227 stars 36 forks source link

alectryon.el should assign a default value to flyspell-prog-text-faces #88

Closed dunnl closed 1 year ago

dunnl commented 1 year ago

I think (defvar flyspell-prog-text-faces) here should be changed to (defvar flyspell-prog-text-faces nil) or something to give the variable a default value. Because if flyspell isn't loaded, the former version leaves the variable void which causes alectryon-mode to fail with the following message when opening any Vernacular file, since it tries to manipulate a void variable.

Debugger entered--Lisp error: (void-variable flyspell-prog-text-faces)
  alectryon-mode()
  run-hooks(change-major-mode-after-body-hook prog-mode-hook proof-mode-hook coq-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook proof-mode-hook coq-mode-hook))
  run-mode-hooks(coq-mode-hook)
  coq-mode()
...snip...
  funcall-interactively(find-file "~/FermatsLastTheorem.v" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)

Or should flyspell be loaded, but it looks like the intention here is to avoid needlessly loading it. I tested this on a fresh Emacs 28.1 with only Alectryon and Proof General installed from MELPA, and (setq debug-on-error t).

cpitclaudel commented 1 year ago

Thanks for the great report. I just pushed a tentative fix, could you give it a try?

dunnl commented 1 year ago

It works. Thanks.

cpitclaudel commented 1 year ago

Beautiful, thanks again for the report!