From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#71469: font-lock does not apply standard faces and their descendants Date: Mon, 10 Jun 2024 14:59:37 +0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5110"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.52.2 To: 71469@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 10 14:33:05 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sGeCu-00010q-AL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Jun 2024 14:33:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGeCf-0002D5-3D; Mon, 10 Jun 2024 08:32:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGeCc-0002CO-KJ for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 08:32:47 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGeCc-0007js-8n for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 08:32:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sGeCt-000486-4f for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 08:33:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jun 2024 12:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71469 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171802275415780 (code B ref -1); Mon, 10 Jun 2024 12:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Jun 2024 12:32:34 +0000 Original-Received: from localhost ([127.0.0.1]:59291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGeCP-00046N-Gj for submit@debbugs.gnu.org; Mon, 10 Jun 2024 08:32:33 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:41086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGeCM-00045G-Dy for submit@debbugs.gnu.org; Mon, 10 Jun 2024 08:32:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGdgl-0007IS-1u for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 07:59:52 -0400 Original-Received: from forward103c.mail.yandex.net ([2a02:6b8:c03:500:1:45:d181:d103]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGdgf-0000WY-KG for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 07:59:49 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:201a:0:640:4af0:0]) by forward103c.mail.yandex.net (Yandex) with ESMTPS id 2829860B1D for ; Mon, 10 Jun 2024 14:59:38 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id bxbmcD1oBuQ0-ct126Mn6; Mon, 10 Jun 2024 14:59:37 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1718020777; bh=uPyP9UVIP6AZX662pn+J7F+ceYALt1XaaKnqi3XKPJM=; h=Date:To:From:Subject:Message-ID; b=KpShXcB6zL4hCeTaQP71BklvhGoMIMUI4pOoRTM+MUNnn1/Ym1w3kKRZ1shJX90rP AxIZ4aDJiEb20A97M7x0Yo8G9JvKhWAZfMkkU2Sl8izwpkVbitWzZKPyc+X104fcB4 ndxplyAyxlaFPGxRikdeiQcCyXYRhvdwK7zytNe4= Authentication-Results: mail-nwsmtp-smtp-production-main-17.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Received-SPF: pass client-ip=2a02:6b8:c03:500:1:45:d181:d103; envelope-from=Hi-Angel@yandex.ru; helo=forward103c.mail.yandex.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287027 Archived-At: While trying to add a face to a major mode I found that both standard faces=C2=B9 and inherited ones are ignored completely. In steps below I create a simple major mode and it uses an inherited face, but face does not get applied. NOTE: if you replace the inherited face with, for example, `font-lock-constant-face`, it will get highlighted. I.e. the problem somehow bound to faces. # Steps to reproduce 1. Create `test.el` file as follows: (defface test-face '((t (:inherit bold))) "Test face.") (define-derived-mode my-mode fundamental-mode "My Mode" "A minimal mode that highlights 'hello world' text." (font-lock-add-keywords nil '(("hello world" 0 test-face))) (font-lock-flush)) (add-to-list 'auto-mode-alist (cons "test.txt" 'my-mode)) (provide 'my-mode) And `test.txt` as follows: =20 =3D=3D> hello world <=3D=3D 2. Launch Emacs as `emacs -Q -l test.el test.txt` 3. Put a caret over the word `hello` and evaluate M-x describe-char ## Expected The description buffer mentions that `face` is `test-face`. ## Actual There is no `face` property at all. # Additional information Versions tested: Emacs built from February master and a stable 29.3 The problem actually doesn't seem to be related to `defface`, because passing `bold` to the `font-lock-add-keywords` had similarly no effect for some reason. More likely it's related to the "standard faces". 1: https://www.gnu.org/software/emacs/manual/html_node/emacs/Standard-Faces= .html