unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Markus Triska <triska@metalevel.at>,
	35005@debbugs.gnu.org, emacs-devel@gnu.org
Subject: bug#35005: 27.0.50; Fontification unexpectedly works with anonymous faces
Date: Thu, 31 Oct 2019 18:24:38 +0100	[thread overview]
Message-ID: <87o8xw6d61.fsf@gnus.org> (raw)
In-Reply-To: <83r2arj7rv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Mar 2019 18:14:28 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> The Elisp info material states in "39.12 Faces": 
>> 
>>       Many parts of Emacs require named faces, and do not accept
>>    anonymous faces. These include the functions documented in Attribute
>>    Functions, and the variable ‘font-lock-keywords’ (see Search-based
>>    Fontification). Unless otherwise stated, we will use the term “face”
>>    to refer only to named faces.
>> 
>> However, when I start Emacs with "emacs -Q", and then evaluate in
>> the *scratch* buffer the form:
>> 
>>     (progn
>>       (font-lock-add-keywords nil '(("hello" 0 '(:background "green")) t))
>>       (insert "hello"))
>> 
>> then I see that "hello" is inserted and highlighted in green, apparently
>> due to search-based fontification where an anonymous face is specified!
>> 
>> I am currently working on an application where this functionality (i.e.,
>> anonymous faces that can be specified for fontification) would be
>> extremely useful. Could you please consider supporting this feature,
>> and - if this already works as intended - officially document it?
>
> I suggest to ask on emacs-devel whether the documentation is correct
> or not.  It's possible that there are some subtle use cases where
> anonymous faces won't work in this situation.  The real experts on
> this matter don't read the bug list.

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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





       reply	other threads:[~2019-10-31 17:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m25zs54mof.fsf@metalevel.at>
     [not found] ` <83r2arj7rv.fsf@gnu.org>
2019-10-31 17:24   ` Lars Ingebrigtsen [this message]
2019-10-31 20:38     ` bug#35005: 27.0.50; Fontification unexpectedly works with anonymous faces Stefan Monnier
2019-11-01 13:13       ` Lars Ingebrigtsen
2019-11-02  9:10         ` Markus Triska
2019-11-02 15:07           ` Lars Ingebrigtsen
2019-11-09 17:43             ` Markus Triska
2019-11-09 18:01               ` Stefan Monnier
2019-11-09 20:02                 ` Lars Ingebrigtsen
2019-11-09 21:02                   ` Markus Triska
2019-11-09 21:10                     ` Stefan Monnier
2019-11-09 21:29                       ` Markus Triska
2019-11-10  1:52                     ` Drew Adams
2019-10-31 21:09     ` Markus Triska

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8xw6d61.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=35005@debbugs.gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=triska@metalevel.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).