]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode: Get proper search limits in c-font-lock-cut-off-declarators
authorAlan Mackenzie <acm@muc.de>
Sun, 25 Apr 2021 17:40:16 +0000 (17:40 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 25 Apr 2021 17:40:16 +0000 (17:40 +0000)
* 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

index fdef0840cdaff9baf1bc88287ef9a71075db980b..a7c87125cdd34f0a1faeca8a6121d00a36d1e613 100644 (file)
@@ -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))