summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-mode.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2022-11-24 10:51:03 +0000
committerAlan Mackenzie <acm@muc.de>2022-11-24 10:51:03 +0000
commit3208a42c47c4f98cb03c4b15164ca83113244b40 (patch)
tree5d0e8391eed6a5885083c6f0e5dec6f664e41f0d /lisp/progmodes/cc-mode.el
parent005efce764c50f5fc68be84a7fb52565b9a2d2bc (diff)
downloademacs-3208a42c47c4f98cb03c4b15164ca83113244b40.tar.gz
emacs-3208a42c47c4f98cb03c4b15164ca83113244b40.tar.bz2
emacs-3208a42c47c4f98cb03c4b15164ca83113244b40.zip
CC Mode: Make it scroll fast over buffers with only #define's
* lisp/progmodes/cc-engine.el (c-forward-over-token): New LIMIT parameter * lisp/progmodes/cc-langs.el (c-anchored-hash-define-no-parens): Replace ill-formed regular expression (which mixed \\sw and character alternative) with simpler efficient regexp. * lisp/progmodes/cc-mode.el (c-fl-decl-end): New forward limit LIM+ used in c-forward-declarator and c-forward-over-token.
Diffstat (limited to 'lisp/progmodes/cc-mode.el')
-rw-r--r--lisp/progmodes/cc-mode.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 99067e47618..6a2c2f2911e 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -2482,7 +2482,8 @@ with // and /*, not more generic line and block comments."
(let* ((lim1 (save-excursion
(and (c-beginning-of-macro)
(progn (c-end-of-macro) (point)))))
- (decl-res (c-forward-declarator)))
+ (lim+ (c-determine-+ve-limit 200))
+ (decl-res (c-forward-declarator lim+)))
(if (or (cadr (cddr (cddr decl-res))) ; We scanned an arglist.
(and (eq (char-after) ?\() ; Move over a non arglist (...).
(prog1 (c-go-list-forward)
@@ -2499,7 +2500,7 @@ with // and /*, not more generic line and block comments."
(c-backward-syntactic-ws lim1)
(eq (char-before) ?\())
(c-fl-decl-end (1- (point))))
- (c-forward-over-token)
+ (c-forward-over-token nil lim+) ; The , or ) after the declarator.
(point))
(if (progn (c-forward-syntactic-ws)
(not (eobp)))