]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Rationalize and optimize cache invalidation (2).
authorAlan Mackenzie <acm@muc.de>
Tue, 15 Oct 2024 21:08:41 +0000 (21:08 +0000)
committerEshel Yaron <me@eshelyaron.com>
Thu, 17 Oct 2024 18:51:04 +0000 (20:51 +0200)
commit31c5a8a244f27eeaaaab16e20d281a79a8df67d8
treeda9f3726259ff5a78f6da7258a20376a8bc6dce9
parent44195ccfefe19f57d4b16f053cf7b5fb9ff2e865
CC Mode: Rationalize and optimize cache invalidation (2).

Replace separate syntax-table text property changes and cache
invalidation with macros which do both together.  Correct a bug
in the invocation of XEmacs's map-extents.

* lisp/progmodes/cc-defs.el (c-put-syntax-table-trim-caches)
(c-clear-syntax-table-trim-caches)
(c-clear-syntax-table-properties-trim-caches)
(c-clear-syntax-table-with-value-trim-caches)
(c-clear-syntax-table-with-value-on-char-trim-caches)
(c-put-syntax-table-properties-on-char-trim-caches): New
macros.
(c-clear-char-properties, c-clear-char-property-with-value)
(c-clear-char-property-with-value-on-char): Correct the
invocation of XEmacs's map-extents by returning nil from the
mapping function to prevent premature exit from map-extents.
(c-clear-char-property-with-value-function)
(c-clear-char-property-with-value)
(c-clear-char-property-with-value-on-char-function)
(c-clear-char-property-with-value-on-char)
(c-put-char-properties-on-char): Enhance to return the position
of the first changed char property (or nil).

* lisp/progmodes/cc-awk.el
(c-awk-set-string-regexp-syntax-table-properties)
(c-awk-set-syntax-table-properties)
* lisp/progmodes/cc-engine.el
(c-depropertize-ml-string-delims)
(c-after-change-unmark-ml-strings, c-propertize-ml-string-id)
(c-propertize-ml-string-opener, c-depropertize-ml-string)
(c-depropertize-ml-strings-in-region)
* lisp/progmodes/cc-mode.el (c-depropertize-CPP)
(c-neutralize-CPP-line, c-put-syn-tab, c-clear-syn-tab)
(c-parse-quotes-before-change, c-parse-quotes-after-change)
(c-before-change-fix-comment-escapes)
(c-after-change-fix-comment-escapes): Use the new macros from
cc-defs.el.

* lisp/progmodes/cc-mode.el
(c-trim-cache-first-punctuation-prop): Remove.
(c-depropertize-CPP): Remove calls to the above function.

(cherry picked from commit fdac10b216f7b47e2eea129d2a96807a0c2055f3)
lisp/progmodes/cc-awk.el
lisp/progmodes/cc-defs.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-mode.el