[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Syntax propertize in font-latex (Re: bug#35140: 12.1; Scan errors in doc
From: |
Ikumi Keita |
Subject: |
Syntax propertize in font-latex (Re: bug#35140: 12.1; Scan errors in doctex mode with ^^A-comments after braces) |
Date: |
Thu, 03 Mar 2022 16:33:33 +0900 |
[ Changed Cc: to auctex-devel. ]
>>>>> Tassilo Horn <tsdh@gnu.org> writes:
> Stefan Monnier via bug-auctex via Bug reporting list for AUCTeX
> <bug-auctex@gnu.org> writes:
>> BTW, I noticed in the patch that `font-latex.el` appears to still make
>> use of `font-lock-syntactic-keywords`. This var has been obsolete
>> since Emacs-24.1 and it's like to disappear in Emacs-29, so it would
>> be good to fix this issue (maybe using
>> `syntax-propertize-via-font-lock`).
> Thanks for the heads-up, I've done that just now.
>
> https://git.savannah.gnu.org/cgit/auctex.git/commit/?id=ab3bfaf1033f0d6e0ecfe3172794a6363450b207
Unfortunately, this breaks regression test and results in:
SUMMARY OF TEST RESULTS
-----------------------
Files examined: 13
Ran 49 tests, 35 results as expected, 11 unexpected, 3 skipped
3 files contained unexpected results:
latex/latex-test.log
latex/font-latex-test.log
context/context-test.log
I encountered the same problem when I tried similar approach before. The
reasons of these errors is that
1. `indent-according-to-mode' requires that syntax propertization is
done.
2. `syntax-propertize-via-font-lock' needs font lock has been
initialized in that buffer.
3. In batch mode, tests run before font lock is initialized because it
doesn't enter command wait loop. For example,
(with-temp-buffer
(LaTeX-mode)
syntax-propertize-function)
returns nil.
Attached is my preliminary attempt to avoid the errors by circumventing
`syntax-propertize-via-font-lock'. (Sorry, it involves some unrelated
changes.) Though I haven't finished it yet, I expect it works basically
and doesn't interfere with regression tests.
The problems is that it requires some changes in entries in
`font-latex-syntactic-keywords', sometimes rather non-trivial ones as
seen in the patch. It's possible to do required changes in files
distributed with AUCTeX, but if some user adds entries to
`font-latex-syntactic-keywords' in their private styles, this
incompatibility can be a non-easy problem.
Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
patch
Description: preliminary patch
- Syntax propertize in font-latex (Re: bug#35140: 12.1; Scan errors in doctex mode with ^^A-comments after braces),
Ikumi Keita <=