From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#58641: 29.0.50; cc-fonts signals void variable: font-lock-reference-face Date: Tue, 25 Oct 2022 10:09:12 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5864"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bug-cc-mode@gnu.org, 58641@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 25 12:13:03 2022 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 1onGvf-0001OO-55 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Oct 2022 12:13:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onGtD-00060l-EQ; Tue, 25 Oct 2022 06:10:31 -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 1onGsq-00056M-Bs for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 06:10:19 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onGsk-0005CT-9V for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 06:10:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1onGsk-000636-4n for bug-gnu-emacs@gnu.org; Tue, 25 Oct 2022 06:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Oct 2022 10:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58641 X-GNU-PR-Package: emacs Original-Received: via spool by 58641-submit@debbugs.gnu.org id=B58641.166669256623199 (code B ref 58641); Tue, 25 Oct 2022 10:10:02 +0000 Original-Received: (at 58641) by debbugs.gnu.org; 25 Oct 2022 10:09:26 +0000 Original-Received: from localhost ([127.0.0.1]:50463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onGs9-000627-QH for submit@debbugs.gnu.org; Tue, 25 Oct 2022 06:09:26 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:21179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onGs4-00061o-R5 for 58641@debbugs.gnu.org; Tue, 25 Oct 2022 06:09:24 -0400 Original-Received: (qmail 18174 invoked by uid 3782); 25 Oct 2022 12:09:13 +0200 Original-Received: from acm.muc.de (p4fe15bed.dip0.t-ipconnect.de [79.225.91.237]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 25 Oct 2022 12:09:13 +0200 Original-Received: (qmail 5360 invoked by uid 1000); 25 Oct 2022 10:09:12 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246137 Archived-At: Hello, Stefan. Sorry it's taken me so long to getting around to answering. The last few days have been a bit busy. On Wed, Oct 19, 2022 at 14:13:22 -0400, Stefan Monnier via CC-Mode-help wrote: > Package: Emacs > Version: 29.0.50 > If I start > % emacs -Q --eval '(make-face `font-lock-reference-face)' -l cc-fonts > I get the error: > defconst: Symbol’s value as variable is void: font-lock-reference-face > Something like the patch below seems in order. GRRRR! Yes, it is in order. A small point, perhaps, but we aim for perfection in CC Mode. ;-) I'll commit this, after checking that the same thing doesn't happen anywhere else in cc-fonts.el. Actually, it does, so I'll correct those other things, too. > Not sure if the FIXME is a confusion of mine or is a real problem. The aliasing of missing faces is a mass of confusion, which takes up more mental energy than it deserves. But yes, it would be better for f-l-reference-face to be mapped to f-l-constant-face before defaulting to c-label-face-name. I'll do this, too. > Stefan > diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el > index aa16da70703..d8776d8322a 100644 > --- a/lisp/progmodes/cc-fonts.el > +++ b/lisp/progmodes/cc-fonts.el > @@ -146,11 +146,14 @@ c-constant-face-name > (defconst c-reference-face-name > (with-no-warnings > (if (and (c-face-name-p 'font-lock-reference-face) > + (boundp 'font-lock-reference-face) > (eq font-lock-reference-face 'font-lock-reference-face)) > ;; This is considered obsolete in Emacs, but it still maps well > ;; to this use. (Another reason to do this is to get unique > ;; faces for the test suite.) > 'font-lock-reference-face > + ;; FIXME: `font-lock-reference-face' was an alias for > + ;; `font-lock-constant-face', not `font-lock-label-face'. > c-label-face-name))) > ;; This should not mapped to a face that also is used to fontify things > @@ -586,7 +589,8 @@ c-fontify-recorded-types-and-refs > (c-lang-const c-opt-cpp-macro-define) > (c-lang-const c-nonempty-syntactic-ws) > "\\(" (c-lang-const ; 1 + ncle + nsws > - c-symbol-key) "\\)" > + c-symbol-key) > + "\\)" > (concat "\\(" ; 2 + ncle + nsws + c-sym-key > ;; Macro with arguments - a "function". > "\\((\\)" ; 3 + ncle + nsws + c-sym-key -- Alan Mackenzie (Nuremberg, Germany).