diff options
author | Alan Mackenzie <acm@muc.de> | 2022-10-26 16:02:49 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-10-26 16:02:49 +0000 |
commit | b7e59b9e194ac287fe627ccb26159d2f6f04939b (patch) | |
tree | b397430cc8ba738a5621822a59ab9463abf3fd72 /lisp/progmodes/cc-engine.el | |
parent | 5d46c0e329b90619b5e36beb376e9c73baf6c44e (diff) | |
download | emacs-b7e59b9e194ac287fe627ccb26159d2f6f04939b.tar.gz emacs-b7e59b9e194ac287fe627ccb26159d2f6f04939b.tar.bz2 emacs-b7e59b9e194ac287fe627ccb26159d2f6f04939b.zip |
c-find-decl-spots: Replace an arbitrary search limit by a parameter
The old arbitrary limit led to errors thrown whilst fontifying large areas of
syntactic whitespace containing "#undef", as in src/comp.c.
* lisp/progmodes/cc-engine.el (c-find-decl-spots): Replace the limit argument
to two calls of c-forward-syntactic-ws by the parameter `cfd-limit'.
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r-- | lisp/progmodes/cc-engine.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index e71560fa25f..ed06807a87e 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -6693,8 +6693,7 @@ comment at the start of cc-engine.el for more info." ;; syntactic ws. (when (and cfd-match-pos (< cfd-match-pos syntactic-pos)) (goto-char syntactic-pos) - (c-forward-syntactic-ws - (min (+ (point) 2000) (point-max))) + (c-forward-syntactic-ws cfd-limit) (and cfd-continue-pos (< cfd-continue-pos (point)) (setq cfd-token-pos (point)))) @@ -6735,8 +6734,7 @@ comment at the start of cc-engine.el for more info." ;; can't be nested, and that's already been done in ;; `c-find-decl-prefix-search'. (when (> cfd-continue-pos cfd-token-pos) - (c-forward-syntactic-ws - (min (+ (point) 2000) (point-max))) + (c-forward-syntactic-ws cfd-limit) (setq cfd-token-pos (point))) ;; Continue if the following token fails the |