]> git.eshelyaron.com Git - emacs.git/commit
C++ Mode: Fix incoorect background fontification of <
authorAlan Mackenzie <acm@muc.de>
Sat, 13 Nov 2021 11:58:26 +0000 (11:58 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 13 Nov 2021 11:58:26 +0000 (11:58 +0000)
commit60a85834202dc4e117d3e5086ab210bcd293d659
tree5f729eb936bde89dc2f07cb7673e516f6a90c085
parentf32280bfa6342090abaa9f015d4cd70fb81bbfef
C++ Mode: Fix incoorect background fontification of <

Where c-record-found-types gets "bound" to itself, we postpone the calling of
c-fontify-new-type on possible new found types until these are confirmed by
the return from the function tentatively finding these types, for exmaple
c-forward-<>-arglist.  We check this "binding" by testing the value of
c-record-found-types.

Correct the background fontification algorithm.

* lisp/progmodes/cc-engine.el (c-record-found-types): Move the definition to
earlier in the file.
(c-add-type-1): Check additionally c-record-found-types is nil before calling
c-fontify-new-found-type.
(c-forward-<>-arglist, c-forward-type): On return from a function which
collects found types in c-record-found-types, call c-fontify-new-found-types
for each such type.

* lisp/progmodes/c-fonts.el (c-force-redisplay): Actually fontify the new
found type.
(c-fontify-new-found-type): Test for font-lock-mode being enabled.  Remove the
spurious condition on the `fontified' text property being nil before causing
c-force-redisplay to get called.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el