From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs,gmane.emacs.devel Subject: bug#35005: 27.0.50; Fontification unexpectedly works with anonymous faces Date: Thu, 31 Oct 2019 18:24:38 +0100 Message-ID: <87o8xw6d61.fsf@gnus.org> References: <83r2arj7rv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="171657"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: Markus Triska , 35005@debbugs.gnu.org, emacs-devel@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 31 18:25:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQEC8-000iPQ-Fw for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2019 18:25:12 +0100 Original-Received: from localhost ([::1]:52966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQEC6-0003I5-Qm for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Oct 2019 13:25:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47626) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQEBz-0003FC-9n for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 13:25:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQEBy-00058z-2l for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 13:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45392) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQEBx-00058j-Vf for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 13:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQEBx-0005po-OU for bug-gnu-emacs@gnu.org; Thu, 31 Oct 2019 13:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Oct 2019 17:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35005 X-GNU-PR-Package: emacs Original-Received: via spool by 35005-submit@debbugs.gnu.org id=B35005.157254268522399 (code B ref 35005); Thu, 31 Oct 2019 17:25:01 +0000 Original-Received: (at 35005) by debbugs.gnu.org; 31 Oct 2019 17:24:45 +0000 Original-Received: from localhost ([127.0.0.1]:54213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQEBg-0005pC-U1 for submit@debbugs.gnu.org; Thu, 31 Oct 2019 13:24:45 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:48742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iQEBf-0005p4-Ez for 35005@debbugs.gnu.org; Thu, 31 Oct 2019 13:24:44 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iQEBb-00033n-CS; Thu, 31 Oct 2019 18:24:41 +0100 In-Reply-To: <83r2arj7rv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Mar 2019 18:14:28 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170541 gmane.emacs.devel:241674 Archived-At: Eli Zaretskii writes: >> The Elisp info material states in "39.12 Faces":=20 >>=20 >> Many parts of Emacs require named faces, and do not accept >> anonymous faces. These include the functions documented in Attribute >> Functions, and the variable =E2=80=98font-lock-keywords=E2=80=99 (see= Search-based >> Fontification). Unless otherwise stated, we will use the term =E2=80= =9Cface=E2=80=9D >> to refer only to named faces. >>=20 >> However, when I start Emacs with "emacs -Q", and then evaluate in >> the *scratch* buffer the form: >>=20 >> (progn >> (font-lock-add-keywords nil '(("hello" 0 '(:background "green")) t= )) >> (insert "hello")) >>=20 >> then I see that "hello" is inserted and highlighted in green, apparently >> due to search-based fontification where an anonymous face is specified! >>=20 >> 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? --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no