]> git.eshelyaron.com Git - emacs.git/commit
C++ Mode. Fix anomaly occurring when a ">" is deleted then reinserted.
authorAlan Mackenzie <acm@muc.de>
Thu, 13 Jul 2017 19:56:00 +0000 (19:56 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 13 Jul 2017 19:56:00 +0000 (19:56 +0000)
commit7eef16a923fa54ec0a88e00e75176a844dbd2944
treeefbc000f0b52351b7ac0321f42cb06c282e5df2e
parent1f08279e1b20bd1e07132b6ee0a25a154811615a
C++ Mode.  Fix anomaly occurring when a ">" is deleted then reinserted.

This fontification anomaly happened because after deleting the ">",
c-forward-<>-arglist parses the preceding identifier as a putative type but
stores it in c-found-types before it becomes clear it is not an unambiguous
type.  c-forward-<>-arglist fails, leaving the spurious type id in
c-found-types.  Fix this by "binding" c-found-types "to itself" in
c-forward-<>-arglist, and restoring the original value when that function call
fails.

* lisp/progmodes/cc-engine.el (c-copy-found-types): New function.
(c-forward-<>-arglist): Record the original value of c-found-types at the
beginning of the function, and restore it at the end on failure.

* lisp/progmodes/cc-mode.el (c-unfind-coalesced-tokens): Rewrite more
accurately.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-mode.el