From 142babb9bd8585136d4d56fb8b6dc2761d891c79 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sun, 25 Apr 2021 17:40:16 +0000 Subject: [PATCH] CC Mode: Get proper search limits in c-font-lock-cut-off-declarators * lisp/progmodes/cc-fonts.el (c-font-lock-cut-off-declarators): Instead of using a crude 2,000 characters back limit for backward searching, which is erroneous when that point is in a literal, use the already calculated c-determine-limit result. --- lisp/progmodes/cc-fonts.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index fdef0840cda..a7c87125cdd 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1669,9 +1669,7 @@ casts and declarations are fontified. Used on level 2 and higher." c-recognize-knr-p) ; Strictly speaking, bogus, but it ; speeds up lisp.h tremendously. (save-excursion - (when (not (c-back-over-member-initializers - (max (- (point) 2000) (point-min)))) ; c-determine-limit - ; is too slow, here. + (when (not (c-back-over-member-initializers decl-search-lim)) (unless (or (eobp) (looking-at "\\s(\\|\\s)")) (forward-char)) -- 2.39.5