diff options
author | Alan Mackenzie <acm@muc.de> | 2019-07-02 12:33:01 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2019-07-02 12:33:01 +0000 |
commit | b25d58c956a9fcd2b81b804699573ea851bd8fde (patch) | |
tree | 75567cf91b5108b6257e2f83ae89a73448ce4581 /lisp/progmodes/cc-langs.el | |
parent | 22b64f7bac8d015f3d0e6a42e9d764a61656e7a1 (diff) | |
download | emacs-b25d58c956a9fcd2b81b804699573ea851bd8fde.tar.gz emacs-b25d58c956a9fcd2b81b804699573ea851bd8fde.tar.bz2 emacs-b25d58c956a9fcd2b81b804699573ea851bd8fde.zip |
CC Mode: Improve handling of unbalanced strings
* lisp/progmodes/cc-fonts.el (c-before-font-lock-functions): Add function
c-after-change-escape-NL-in-string into value for most languages.
* lisp/progmodes/cc-mode.el (c-after-change-escape-NL-in-string): New
function.
(c-before-change-check-unbalanced-strings): Handle the making and breaking of
escaped newlines, by removal or addition of text.
Diffstat (limited to 'lisp/progmodes/cc-langs.el')
-rw-r--r-- | lisp/progmodes/cc-langs.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 2fcd6acf51f..153d3fc2608 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -478,7 +478,7 @@ so that all identifiers are recognized as words.") (list fs))) "If non-nil, a list of functions called from c-before-change-hook. Typically these will record enough state to allow -`c-before-font-lock-function' to extend the region to fontify, +`c-before-font-lock-functions' to extend the region to fontify, and may do such things as removing text-properties which must be recalculated. @@ -497,15 +497,18 @@ parameters \(point-min) and \(point-max).") ;; For documentation see the following c-lang-defvar of the same name. ;; The value here may be a list of functions or a single function. t '(c-depropertize-new-text + c-after-change-escape-NL-in-string c-after-change-mark-abnormal-strings c-change-expand-fl-region) (c objc) '(c-depropertize-new-text + c-after-change-escape-NL-in-string c-parse-quotes-after-change c-after-change-mark-abnormal-strings c-extend-font-lock-region-for-macros c-neutralize-syntax-in-CPP c-change-expand-fl-region) c++ '(c-depropertize-new-text + c-after-change-escape-NL-in-string c-after-change-unmark-raw-strings c-parse-quotes-after-change c-after-change-mark-abnormal-strings @@ -514,6 +517,7 @@ parameters \(point-min) and \(point-max).") c-restore-<>-properties c-change-expand-fl-region) java '(c-depropertize-new-text + c-after-change-escape-NL-in-string c-parse-quotes-after-change c-after-change-mark-abnormal-strings c-restore-<>-properties |