unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 58641@debbugs.gnu.org
Cc: bug-cc-mode@gnu.org
Subject: bug#58641: 29.0.50; cc-fonts signals void variable: font-lock-reference-face
Date: Wed, 19 Oct 2022 14:13:22 -0400	[thread overview]
Message-ID: <jwva65rsmv1.fsf@iro.umontreal.ca> (raw)

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.
Not sure if the FIXME is a confusion of mine or is a real problem.


        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






             reply	other threads:[~2022-10-19 18:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 18:13 Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-10-25 10:09 ` bug#58641: 29.0.50; cc-fonts signals void variable: font-lock-reference-face Alan Mackenzie
2022-10-25 12:51   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-25 13:43     ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwva65rsmv1.fsf@iro.umontreal.ca \
    --to=bug-gnu-emacs@gnu.org \
    --cc=58641@debbugs.gnu.org \
    --cc=bug-cc-mode@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).