unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69714: 30.0.50; ert-font-lock doesn't handle list of faces
@ 2024-03-10 20:31 Troy Brown
  2024-03-11  8:36 ` Vladimir Kazanov
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Troy Brown @ 2024-03-10 20:31 UTC (permalink / raw)
  To: 69714; +Cc: Vladimir Kazanov

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.





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-04-01  9:15 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-10 20:31 bug#69714: 30.0.50; ert-font-lock doesn't handle list of faces Troy Brown
2024-03-11  8:36 ` Vladimir Kazanov
2024-03-12 20:46   ` Vladimir Kazanov
2024-03-13 16:14     ` Troy Brown
2024-03-13 17:04       ` Vladimir Kazanov
2024-03-13 17:48         ` Troy Brown
2024-03-13 18:20           ` Vladimir Kazanov
2024-03-15 11:47 ` bug#69714: [PATCH] Improve ert-font-lock assertion parser (Bug#69714) Vladimir Kazanov
2024-03-28  9:41   ` Eli Zaretskii
2024-03-30 12:52 ` bug#69714: [PATCH] Improve ert-font-lock assertion parser Mattias Engdegård
2024-03-31 17:56   ` Vladimir Kazanov
2024-04-01  8:04     ` Mattias Engdegård
2024-04-01  8:17       ` Mattias Engdegård
2024-04-01  8:34         ` Vladimir Kazanov
2024-04-01  9:08           ` Mattias Engdegård
2024-04-01  9:12             ` Vladimir Kazanov
2024-04-01  9:15               ` Mattias Engdegård

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).