[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 04b9a6d1: Improve shortvrb.sty support
From: |
Ikumi Keita |
Subject: |
Re: master 04b9a6d1: Improve shortvrb.sty support |
Date: |
Thu, 27 Apr 2023 13:54:02 +0900 |
Hi Arash,
>>>>> Arash Esbati <arash@gnu.org> writes:
> It seems that the Fontification is bleeding, but I can't see why and if
> I open the test in a regular .tex file, it works as expected. I'm
> attaching the change, do you see what's going wrong?
It turned out that the following piece of code in font-latex-test.el is
the culprit:
(define-advice LaTeX-common-initialization (:after ())
(font-lock-ensure))
Due to this advice, syntax propertization runs before
`font-latex-syntactic-keywords-extra' is ready, so emacs thinks that
"Syntax propertization is already done." and doesn't apply the updated
contents of `font-latex-syntactic-keywords-extra'.
We can circumvent this situation by inserting
(syntax-ppss-flush-cache (point-min))
between
(TeX-update-style t)
and
(font-lock-ensure)
in `font-latex-shortvrb-chars' in font-latex-test.el.
(In a longer term perspective, we should factor out the syntax
propertization facility out of font-latex.el and implement it as a major
mode functionality in order to avoid these gotchas due to involvement of
syntax propertization and font lock.)
By the way, I think these syntax table codes in shortvrb.el are no
longer necessary, aren't they?
;; Syntax
(when LaTeX-shortvrb-chars
(let ((st (make-syntax-table (syntax-table))))
(dolist (c LaTeX-shortvrb-chars)
(modify-syntax-entry c "\"" st))
(set-syntax-table st)))
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine