]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: correct the calculation and handling of c-use-category.
authorAlan Mackenzie <acm@muc.de>
Tue, 26 Jul 2022 19:43:13 +0000 (19:43 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 26 Jul 2022 19:43:13 +0000 (19:43 +0000)
commit004ee6b0460c450308c83dffc567fb1b8672777c
tree4e83d946079ccb86eddb31bd6be5e3dd5d9b8f32
parent058d3c0d163edd8074252a3062e9f28f75af316a
CC Mode: correct the calculation and handling of c-use-category.

This fixes bug #56629.  The use of c-use-category was inconsistent, with the
result that it would be nil at compilation time, but t at run time.  This
resulted in wrongly writing syntax-table text properties to <s and >s, yet
testing for category properties on them.

* lisp/progmodes/cc-defs.el (c-use-category): Move to after the definition of
c-<-as-paren-syntax and c->-as-paren-syntax so as correctly to be able to use
their values.  Put an eval-when-compile around the calculation of its value,
to reduce the chances of future failure.
(c-mark-<-as-paren, c-mark->-as-paren, c-unmark-<->-as-paren, c-sc-scan-lists)
(c-sc-parse-partial-sexp): Wrap c-use-category in (eval-when-compile ...) as
an optimization, preventing the XEmacs code also being generated.
lisp/progmodes/cc-defs.el