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.