]> git.eshelyaron.com Git - emacs.git/commit
Restore fontification of delimiters of multiline CC Mode strings.
authorAlan Mackenzie <acm@muc.de>
Thu, 25 Apr 2019 18:00:15 +0000 (18:00 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 25 Apr 2019 18:00:15 +0000 (18:00 +0000)
commit0c2d921a75375e5667224bfd92b28be3b77977b3
tree6d897212bd8844da18d2b2937fb6cbc5d18550e9
parent6d8e0fc5aa7673540486af9ecbfc0a3e23c305cf
Restore fontification of delimiters of multiline CC Mode strings.

E.g., on typing the closing delimiter of a string continued onto a second
line, the opening delimiter retained its font-lock-warning-face.

* lisp/progmodes/cc-defs.el (c-c++-raw-string-opener-re)
(c-c++-raw-string-opener-1-re): New constants.
(c-sub-at-c++-raw-string-opener, c-at-c++-raw-string-opener): New macros.

* lisp/progmodes/cc-engine.el (c-raw-string-pos)
(c-depropertize-raw-strings-in-region, c-after-change-unmark-raw-strings):
Replace uses of open-coded raw string regexps by the new constants and macros
in cc-defs.el.

* lisp/progmodes/cc-fonts.el (c-font-lock-raw-strings): Ditto

* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Set
c-new-BEG to the beginning of the string when we encounter its closing ".
When not in a raw string, but in a string, clear syntax-table properties from
its delimiters and set c-new-BEG/END to its limits.
(c-after-change-mark-abnormal-strings): When applying syntax-table properties
to string delimiters, also set c-new-BEG/END to ensure subsequent
fontification.
lisp/progmodes/cc-defs.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-mode.el