From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.devel Subject: Support for fontification with anonymous faces Date: Sat, 30 Mar 2019 09:48:34 +0100 Message-ID: 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="196823"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 30 09:48:49 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hA9fV-000p6S-Gc for ged-emacs-devel@m.gmane.org; Sat, 30 Mar 2019 09:48:49 +0100 Original-Received: from localhost ([127.0.0.1]:59096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA9fU-00078O-Ht for ged-emacs-devel@m.gmane.org; Sat, 30 Mar 2019 04:48:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA9fL-000783-8x for emacs-devel@gnu.org; Sat, 30 Mar 2019 04:48:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hA9fK-0000rT-Db for emacs-devel@gnu.org; Sat, 30 Mar 2019 04:48:39 -0400 Original-Received: from metalevel.at ([78.46.218.83]:44744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA9fK-0000qn-5F for emacs-devel@gnu.org; Sat, 30 Mar 2019 04:48:38 -0400 Original-Received: from mt-mbpro.localdomain (localhost.localdomain [127.0.0.1]) by metalevel.at (Postfix) with ESMTP id 1D181A0097 for ; Sat, 30 Mar 2019 09:48:35 +0100 (CET) Original-Received: by mt-mbpro.localdomain (Postfix, from userid 501) id D318DF129EC; Sat, 30 Mar 2019 09:48:34 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 78.46.218.83 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234817 Archived-At: Dear all, the Elisp info material states in "39.12 Faces":=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 Se= arch-based Fontification). Unless otherwise stated, we will use the term =E2=80=9Cf= ace=E2=80=9D 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? This is also filed as issue #35005, where Eli suggested to ask here. Thank you and all the best! Markus