]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Optimize for scrolling large buffers containing few braces
authorAlan Mackenzie <acm@muc.de>
Tue, 15 Dec 2020 12:09:47 +0000 (12:09 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 15 Dec 2020 12:14:50 +0000 (12:14 +0000)
commit92c56300c317c9e5573dca787a2cf20f777b3179
tree34ca77d2afa274672e1ebe8ee0474bb7b319ac54
parentc8aad8cc11ccfda64a07cfc9675c6e6b07d552fa
CC Mode: Optimize for scrolling large buffers containing few braces

This fixes bug #25706.  It particularly pertains to .h files which contain
only macro definitions.  Many of these files are to be found, for example, in
the driver sections of the Linux kernel.

* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1, c-on-identifier)
(c-syntactic-skip-backward, c-find-decl-prefix-search, c-find-decl-spots)
(c-forward-name, c-back-over-list-of-member-inits)
(c-back-over-member-initializers, c-looking-at-inexpr-block)
(c-guess-basic-syntax): Give search limits to, or amend existing ones to
c-backward-syntactic-ws, c-forward-syntactic-ws, c-backward-token-2,
c-beginning-of-statement-1.
(c-determine-limit-no-macro): New function.
(c-determine-limit-get-base): Remove unlimted invocation of
c-backward-syntactic-ws.
(c-determine-limit): Exclude movement between two different macros.  Use new
function c-determine-limit-no-macro.
(c-back-over-list-of-member-inits): New parameter `limit'.

* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare)
(c-font-lock-declarations, c-font-lock-c++-using): Give search limits to, or
amend existing ones to c-backward-syntactic-ws, c-beginning-of-decl-1.

* lisp/progmodes/cc-mode.el (c-unfind-coalesced-tokens, c-before-changer)
(c-fl-decl-end): Give search limits to, or amend existing ones to
c-backward-syntactic-ws, c-forward-syntactic-ws, skip-chars-backward,
skip-chars-forward.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-mode.el