Subject: bug#35005: 27.0.50; Fontification unexpectedly works with anonymous faces

From: Stefan Monnier <[email-masked]>
Date: Thu, 31 Oct 2019 16:38:38 -0400

> I'm not sure whether this was ever brought up on emacs-devel?  I
> wondered about that restriction myself -- I could see why it might be an
> issue (some parts of the font locking machinery checking for whether an
> element is a list and interpreting is as something other than a face),
> but it would be nice if this worked with anonymous faces.
>
> Does anybody know what the manual is referring to here, or whether it's
> an outdated restriction that has gone away?

AFAIK anonymous faces work fine in font-lock.  They can be a bit more
delicate to us because many places that accept faces also accept lists
(either of faces or of other things) but in general there's no real
restriction that I know of.

So I think the "do not accept" part is not true (any more?), but it's
still the case that you're generally better off using named faces
when possible.

        Stefan