]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix wrong bound to c-font-lock-declarators. Fixes bug #18948.
authorAlan Mackenzie <acm@muc.de>
Wed, 5 Nov 2014 17:57:50 +0000 (17:57 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 5 Nov 2014 17:57:50 +0000 (17:57 +0000)
progmodes/cc-fonts.el (c-font-lock-declarations): Pass "(point-max)" as
bound to c-font-lock-declarators, not "limit", as the buffer is sometimes
narrowed to less than "limit" (e.g., in the presence of macros).

lisp/ChangeLog
lisp/progmodes/cc-fonts.el

index 4a3b1dcd96afbb5cf2d1e4a16da39b450de66115..111f98b8d4e816eb300cfe3d167fd91ee4c7c6a8 100644 (file)
@@ -1,3 +1,11 @@
+2014-11-05  Alan Mackenzie  <acm@muc.de>
+
+       Fix wrong bound to c-font-lock-declarators.  Fixes bug #18948.
+       * progmodes/cc-fonts.el (c-font-lock-declarations): Pass
+       "(point-max)" as bound to c-font-lock-declarators, not "limit", as
+       the buffer is sometimes narrowed to less than "limit" (e.g., in
+       the presence of macros).
+
 2014-11-05  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-error-with-buffer): Show connection buffer
index bf5630da0457fa3060229bcea00e140b62660be2..6ebd6c6a8fc0ac0d2d5a237aa0ff32ed5f31e700 100644 (file)
@@ -1279,6 +1279,8 @@ casts and declarations are fontified.  Used on level 2 and higher."
        c-font-lock-maybe-decl-faces
 
        (lambda (match-pos inside-macro)
+        ;; Note to maintainers: don't use `limit' inside this lambda form;
+        ;; c-find-decl-spots sometimes narrows to less than `limit'.
         (setq start-pos (point))
         (when
          ;; The result of the form below is true when we don't recognize a
@@ -1507,7 +1509,7 @@ casts and declarations are fontified.  Used on level 2 and higher."
                        ;; At a real declaration?
                        (if (memq (c-forward-type t) '(t known found))
                            (progn
-                             (c-font-lock-declarators limit t is-typedef)
+                             (c-font-lock-declarators (point-max) t is-typedef)
                              nil)
                          ;; False alarm.  Return t to go on to the next check.
                          (goto-char start-pos)