[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Font-lock error when using "flyspell-buffer" upon opening a tex file
From: |
Arash Esbati |
Subject: |
Re: Font-lock error when using "flyspell-buffer" upon opening a tex file |
Date: |
Tue, 04 Apr 2023 10:00:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Ruiyang Wu <ywwry66@gmail.com> writes:
> To get rid of the errors, I have to defer running “flyspell-buffer” as
> late as possible. For example, using idle timer with 0s idle interval
> for “flyspell-buffer” will work. However, idle timer is a bit tricky
> to use and will cause warnings in other modes (e.g. markdown mode). So
> this workaround is still not ideal. I wonder what would be the proper
> fix for this issue. Thank you for the help!
Maybe I missed the Emacs version you're using, but you can try to update
the fontification before you turn-on-flyspell. So with Emacs 28, you
could write something like this:
(add-hook 'LaTeX-mode-hook
(lambda ()
(font-lock-update)
(turn-on-flyspell)
(flyspell-buffer))
t)
which doesn't throw an error for me.
HTH. Best, Arash