mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
CC Mode: correct the handling of empty strings
In particular, have the macro cache invalidated after its last use in c-before-change. * lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Remove c-invalidate-macro-cache from the entries it's in, moving it to.... * lisp/progmodes/cc-mode.el (c-before-change): Call c-invalidate-macro-cache directly from the functions, after the call to c-invalidate-state-cache.
This commit is contained in:
parent
c4c8da67e8
commit
059f1863a2
2 changed files with 5 additions and 3 deletions
|
|
@ -457,13 +457,11 @@ so that all identifiers are recognized as words.")
|
||||||
c-before-change-check-raw-strings
|
c-before-change-check-raw-strings
|
||||||
c-before-change-check-<>-operators
|
c-before-change-check-<>-operators
|
||||||
c-depropertize-CPP
|
c-depropertize-CPP
|
||||||
c-invalidate-macro-cache
|
|
||||||
c-truncate-bs-cache
|
c-truncate-bs-cache
|
||||||
c-before-change-check-unbalanced-strings
|
c-before-change-check-unbalanced-strings
|
||||||
c-parse-quotes-before-change)
|
c-parse-quotes-before-change)
|
||||||
(c objc) '(c-extend-region-for-CPP
|
(c objc) '(c-extend-region-for-CPP
|
||||||
c-depropertize-CPP
|
c-depropertize-CPP
|
||||||
c-invalidate-macro-cache
|
|
||||||
c-truncate-bs-cache
|
c-truncate-bs-cache
|
||||||
c-before-change-check-unbalanced-strings
|
c-before-change-check-unbalanced-strings
|
||||||
c-parse-quotes-before-change)
|
c-parse-quotes-before-change)
|
||||||
|
|
|
||||||
|
|
@ -2065,7 +2065,11 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
|
||||||
;; The following must be done here rather than in `c-after-change'
|
;; The following must be done here rather than in `c-after-change'
|
||||||
;; because newly inserted parens would foul up the invalidation
|
;; because newly inserted parens would foul up the invalidation
|
||||||
;; algorithm.
|
;; algorithm.
|
||||||
(c-invalidate-state-cache beg)))
|
(c-invalidate-state-cache beg)
|
||||||
|
;; The following must happen after the previous, which likely alters
|
||||||
|
;; the macro cache.
|
||||||
|
(when c-opt-cpp-symbol
|
||||||
|
(c-invalidate-macro-cache beg end))))
|
||||||
|
|
||||||
(defvar c-in-after-change-fontification nil)
|
(defvar c-in-after-change-fontification nil)
|
||||||
(make-variable-buffer-local 'c-in-after-change-fontification)
|
(make-variable-buffer-local 'c-in-after-change-fontification)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue