]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: optimize for repeated simple operations.
authorAlan Mackenzie <acm@muc.de>
Mon, 29 Jun 2020 19:10:09 +0000 (19:10 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 29 Jun 2020 19:10:09 +0000 (19:10 +0000)
commit519e64f98140b984e10a9567017c7e5c4a81ff89
treef4576a3033ba65d5fa42fc4c8fad2e9d2f844512
parentd0872638b4f6330bdece465d6cbf5c1d85306c35
CC Mode: optimize for repeated simple operations.

Do this by recognising that unterminated strings in a buffer are typically
going to be few and close together.  Also optimize code for C++ attributes.

* lisp/progmodes/cc-defs.el (c-previous-single-property-change): New macro.
(c-put-syn-tab, c-clear-syn-tab): Turned from macros into functions, and moved
to cc-mode.el.
(c-clear-syn-tab-properties): Amended to use c-min/max-syn-tab-mkr.
(c-with-extended-string-fences): Removed.

* lisp/progmodes/cc-engine-el (c-enclosing-c++-attribute): Rewritten for
speed.
(c-slow-enclosing-c++-attribute): Removed.
(c-semi-pp-to-literal): Remove a superfluous call to
c-with-extended-string-fences.

* lisp/progmodes/cc-mode.el (c-min-syn-tab-mkr, c-max-syn-tab-mkr): two new
marker variables which bound the region occupied by positions with
c-fl-syn-tab text properties.
(c-basic-common-init): Initialize these two variables.
(c-fl-syn-tab-region): Removed.
(c-put-syn-tab, c-clear-syn-tab): Functions moved from cc-defs.el.
(c-clear-string-fences): Amended to use the new scheme.
(c-restore-string-fences): Now takes no arguments; amended to use the new
scheme.
(c-font-lock-fontify-region): Amended to use the new scheme.
lisp/progmodes/cc-defs.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-mode.el