Fontify C, C++, Objective C identifiers containing $
authorAlan Mackenzie <acm@muc.de>
Wed, 28 Jun 2023 18:29:39 +0000 (18:29 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 28 Jun 2023 18:29:39 +0000 (18:29 +0000)
commitd6bcb39ba9d46f7dc29e01551a1d35fe250695a9
tree85efb4af0b7dc5e2f757a35dedc46fda9da7f5b9
parentc5d6102313076b83526dc79bfb563621671fb70b
Fontify C, C++, Objective C identifiers containing $

Optionally, fontify them with font-lock-warning-face.
This fixes bug#64204.

* lisp/progmodes/cc-fonts.el (c-font-lock-ids-with-dollar):
New function.
(c-simple-decl-matchers, c-complex-decl-matchers): invoke
c-font-lock-ids-with-dollar for pertinent languages.

* lisp/progmodes/cc-langs.el (c-symbol-start): Add `$' to the
character list.
(c-dollar-in-ids): New lang const.
(c-symbol-key): For the Pike value, use the AWK value rather
than the C value as the basis, as the latter is no longer
suitable.

* lisp/progmodes/cc-vars.el (c-warn-ids-with-dollar): New
customizable option.

* doc/misc/cc-mode.texi ("Miscellaneous Font Locking"): Add a
section on the new optional fontification of identifiers with
'font-lock-warning-face'.
doc/misc/cc-mode.texi
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-langs.el
lisp/progmodes/cc-vars.el