From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#71469: font-lock does not apply standard faces and their descendants Date: Fri, 4 Oct 2024 18:39:06 -0700 Message-ID: References: <86tti17y8y.fsf@gnu.org> <519d35a7717587222c5da915a9e02ccaa06e9c5b.camel@yandex.ru> <86plso96a9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2672"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 71469@debbugs.gnu.org, Konstantin Kharlamov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 05 03:41:27 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 1swtnT-0000Vs-At for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Oct 2024 03:41:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swtn2-00080e-GS; Fri, 04 Oct 2024 21:41:00 -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 1swtn1-00080B-2w for bug-gnu-emacs@gnu.org; Fri, 04 Oct 2024 21:40:59 -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 1swtn0-00080c-PR for bug-gnu-emacs@gnu.org; Fri, 04 Oct 2024 21:40:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=/FiHRoVZyK2pNDyC75ua0KQv0i5IbLu7JbVbNVW4CKY=; b=PJbq5pDxvdPA9pM8aoM4spwO2srDseXBywPEa41Mljeb+Sz2i9k/0v5SePAWj0qY3BajIk2NN0djJRbLTmTPosCBncK81jy6Tr2DAVfOI8EWqkf1X3RTkRPbPoy9GukJORMsd/jHysGMNnviSlLWGHGZfxHoAEQgrtmzWkXov+UsD10FiUszBS1C+SivbtSOO+aOwU/vv9g6/Tn74Uf4nO0QoWTn1gcWmCZ8vRClF/h5KhdYx1H3PZf/asV2rs6qkn4N+vYnRCFbIlCvw7NtA88rIqj9HyuY7tpx6KwGDAhSjHjy0BzHtLjng1KnrkPi6JpJeMjIMUNMYaK/Afgu3w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swtn4-00031l-JQ for bug-gnu-emacs@gnu.org; Fri, 04 Oct 2024 21:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Oct 2024 01:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71469 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 71469-submit@debbugs.gnu.org id=B71469.172809242011555 (code B ref 71469); Sat, 05 Oct 2024 01:41:02 +0000 Original-Received: (at 71469) by debbugs.gnu.org; 5 Oct 2024 01:40:20 +0000 Original-Received: from localhost ([127.0.0.1]:37017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swtmN-0002xf-Id for submit@debbugs.gnu.org; Fri, 04 Oct 2024 21:40:20 -0400 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:59864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swtmL-0002s7-0H for 71469@debbugs.gnu.org; Fri, 04 Oct 2024 21:40:17 -0400 Original-Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5c718bb04a3so3363188a12.3 for <71469@debbugs.gnu.org>; Fri, 04 Oct 2024 18:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728092347; x=1728697147; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=/FiHRoVZyK2pNDyC75ua0KQv0i5IbLu7JbVbNVW4CKY=; b=hlV2vSunoge7jbAswX7zkkEWKrFFTf+AYojpltrWUp3ncjeOBcOehJwFodjL7903XY 5fcFmfr3PzqH+d2KzKB4pTDMIWNocE7+1+jZPnhO+rJfZgOtuf429FulTmOa3teiVVUz ptNeXmySE79/Cp0h/UR3GwT7AMTYp/treD5d0Ab/KqxiudHhmGqcGGCSKP74wJP6RifT TYzt1u7wNKKF3F5ChB7/wQUct+L/pcfyJKn7pCaV4sqNLRgk8lzdCHQaiocBTp+q+JOw j7lw+BCcVb5+EmGLbCx/PQOmIA8ndngEKymPYa7o3Ro//ezCuBz3ScIrAvWkHJKnxYcf DT3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728092347; x=1728697147; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/FiHRoVZyK2pNDyC75ua0KQv0i5IbLu7JbVbNVW4CKY=; b=aQuEL/SGqPtYEyymir1cLdaukUxh+aYI0z45r+ZGLWfietXt/D+WbFtkgcT8Rkw9mj vKewlJ7hHtD1/eVs9PqxcRnPro90mFqnjOHWVpEBvst4RfJKwy7zi+VWodgNGyH45pr+ IuiJtInX2r4UNR1M7/ulQZVXBYfMeqJLidiCmPxBG7FEC+YScp9SVQ8eMLoApIzT2jCr A7vdIFmw4asKrrervvAPC/caUzfFwzMqO62fAiqNIpJFkji8L1MX/kmI9Cdjb3xA4hA3 1uMlUVlk9X6ugpzuYgnm8oQn0BLIxjGJy9Qd6EzdDGVvqwDSVs+jOfdR7QY7xk/Tnys0 UuyQ== X-Forwarded-Encrypted: i=1; AJvYcCWC4KWq60Hpop/fkSdY/SL9RljsPzDxYDNW1EKVEoCz15LVn4mZyngdj5OjXLb+s8oq/s/81Q==@debbugs.gnu.org X-Gm-Message-State: AOJu0YziQwJAiRqqgF9Mdr0FqciKuQFKK+MQYHRA0R6CA5nTe4ynamW1 a6CMn5MG5xU5Uc8Qd71zJEGc9TAOWfgKbzLZnlNNwJH0F7oGoLqEww8HW7n9V2WfAkCA6GWAHyx GH8XwbxITi+L5RrlBh2UDmPCrgajoXg== X-Google-Smtp-Source: AGHT+IEJVlRk7uSlhMoV+VdjY172QteqT1GNNZKDEQZ95tWR/tmO7pPIg3pb+u32TJtyts8CLIt/r2w0pDJsVuBoOcM= X-Received: by 2002:a05:6402:34d0:b0:5c8:8381:c246 with SMTP id 4fb4d7f45d1cf-5c8d2dfda00mr3564393a12.3.1728092347114; Fri, 04 Oct 2024 18:39:07 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 4 Oct 2024 18:39:06 -0700 In-Reply-To: (Stefan Monnier's message of "Mon, 10 Jun 2024 13:26:19 -0400") 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:292994 Archived-At: Stefan Monnier writes: >>> I'm wondering if it would be okay to mention such nuance in the >>> "standard faces" documentation, such as with the attached patch? I >>> think it would be really helpful, because the nuance of how it works is >>> not obvious at all (it would be much easier if none of the faces such >>> as font-lock-keyword-face, would be defining a variable). > > No face defines a variable. > > Some faces (mostly font-lock faces) have an associated variable whose > content is "the face name" (which is also the variable's name), but it's > not a result of the face itself. It's a separate explicit definition of > a variable with the same name as the face. > > And I agree that it would be simpler if we didn't have those, but > they've been with us since `font-lock.el` in Emacs-19, so it's not easy > to get rid of them. We have occasionally declared things obsolete with the understanding that they'll be deleted much later than the normal "10 years, give or take". See the comment in `interactive-p', for example. The patch below gives me 64 warnings in our tree. I'm not sure if it's worth installing or not. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 7b077a826bf..7787af43bc9 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -316,46 +316,74 @@ font-lock-verbose ;; need to create variables that specify face names. Simply using ;; faces directly is enough. Font-lock is not a template to be ;; followed in this area. +(make-obsolete-variable 'font-lock-comment-face + "use 'font-lock-comment-face instead." "31.1") (defvar font-lock-comment-face 'font-lock-comment-face "Face name to use for comments.") +(make-obsolete-variable 'font-lock-comment-delimiter-face + "use 'font-lock-comment-delimiter-face instead." "31.1") (defvar font-lock-comment-delimiter-face 'font-lock-comment-delimiter-face "Face name to use for comment delimiters.") +(make-obsolete-variable 'font-lock-string-face + "use 'font-lock-string-face instead." "31.1") (defvar font-lock-string-face 'font-lock-string-face "Face name to use for strings.") +(make-obsolete-variable 'font-lock-doc-face + "use 'font-lock-doc-face instead." "31.1") (defvar font-lock-doc-face 'font-lock-doc-face "Face name to use for documentation.") +(make-obsolete-variable 'font-lock-doc-markup-face + "use 'font-lock-doc-markup-face instead." "31.1") (defvar font-lock-doc-markup-face 'font-lock-doc-markup-face "Face name to use for documentation mark-up.") +(make-obsolete-variable 'font-lock-keyword-face + "use 'font-lock-keyword-face instead." "31.1") (defvar font-lock-keyword-face 'font-lock-keyword-face "Face name to use for keywords.") +(make-obsolete-variable 'font-lock-builtin-face + "use 'font-lock-builtin-face instead." "31.1") (defvar font-lock-builtin-face 'font-lock-builtin-face "Face name to use for builtins.") +(make-obsolete-variable 'font-lock-function-name-face + "use 'font-lock-function-name-face instead." "31.1") (defvar font-lock-function-name-face 'font-lock-function-name-face "Face name to use for function names.") +(make-obsolete-variable 'font-lock-variable-name-face + "use 'font-lock-variable-name-face instead." "31.1") (defvar font-lock-variable-name-face 'font-lock-variable-name-face "Face name to use for variable names.") +(make-obsolete-variable 'font-lock-type-face + "use 'font-lock-type-face instead." "31.1") (defvar font-lock-type-face 'font-lock-type-face "Face name to use for type and class names.") +(make-obsolete-variable 'font-lock-constant-face + "use 'font-lock-constant-face instead." "31.1") (defvar font-lock-constant-face 'font-lock-constant-face "Face name to use for constant and label names.") +(make-obsolete-variable 'font-lock-warning-face + "use 'font-lock-warning-face instead." "31.1") (defvar font-lock-warning-face 'font-lock-warning-face "Face name to use for things that should stand out.") +(make-obsolete-variable 'font-lock-negation-char-face + "use 'font-lock-negation-char-face instead." "31.1") (defvar font-lock-negation-char-face 'font-lock-negation-char-face "Face name to use for easy to overlook negation. This can be an \"!\" or the \"n\" in \"ifndef\".") +(make-obsolete-variable 'font-lock-preprocessor-face + "use 'font-lock-preprocessor-face instead." "31.1") (defvar font-lock-preprocessor-face 'font-lock-preprocessor-face "Face name to use for preprocessor directives.")