GNU bug report logs -
#69714
30.0.50; ert-font-lock doesn't handle list of faces
Previous Next
Reported by: Troy Brown <brownts <at> troybrown.dev>
Date: Sun, 10 Mar 2024 20:33:02 UTC
Severity: normal
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#69714: 30.0.50; ert-font-lock doesn't handle list of faces
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 69714 <at> debbugs.gnu.org.
--
69714: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69714
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
> From: Vladimir Kazanov <vekazanov <at> gmail.com>
> Date: Fri, 15 Mar 2024 11:47:27 +0000
>
> I've come up with a number of improvements for ert-font-lock as
> requested in Bug#69714 (which can be closed now).
>
> The attached patch provides the fix, more unit tests and updated
> documentation. I don't think we need to update NEWS as ert-font-lock
> was announced there already.
Thanks, installed on master, and closing the bug.
[Message part 3 (message/rfc822, inline)]
I'm trying to use this package to test out my tree-sitter mode, but am
running into an issue with lists of faces. It's possible that the
face for a location in the buffer will contain a list of 1 or more
faces. For example, when I use the ":override 'prepend" keyword in
the call to treesit-font-lock-rules, even if only a single face is
specified for the rule that matches that section of the buffer, this
will result in a list of one entry (i.e., "(face-name)").
When this happens, ert-font-lock fails to recognize that this matches
the face "face-name" (e.g., "^ face-name" will fail to match in this
case). I feel the tool should recognize a list containing a single
face as matching the face. Even worse however, it appears
ert-font-lock doesn't support a list of faces in the comment. I tried
to work around the original issue by using "^ (face-name)", but the
tool silently ignores this, as it doesn't match the internal regular
expression (which ended up allowing my test to pass without actually
checking anything).
I can't figure out a way to use this tool in its current state due to
its lack of support for a list of faces. Also, I find that since it
silently ignores incorrect comment syntax (e.g., "^face-name", "^
(face-name)"), it gives a false illusion that it's actually performing
those checks (and the checks are passing), when it's really just
ignoring them. Maybe any comment line starting with a "^" or "<-"
should be considered an assertion check and to fail if the rest of the
syntax is not as expected. Maybe it should also fail the test if no
assertion checks are found in a source file or string.
Even if the tool would allow a list of a single face to match the
supplied face in the comment, I think it should also allow for
multiple faces to be listed in the comment. I have other places where
multiple faces are used (e.g., "(font-lock-constant-face
font-lock-variable-name-face)" to highlight a constant variable),
which would not be testable with the current state of the package.
This bug report was last modified 1 year and 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.