]> git.eshelyaron.com Git - emacs.git/commitdiff
(font-lock-fontify-syntactic-keywords-region):
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 19 Feb 2009 22:24:04 +0000 (22:24 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 19 Feb 2009 22:24:04 +0000 (22:24 +0000)
Make sure we stop when we reach the limit.

lisp/ChangeLog
lisp/font-lock.el

index cd977569914372cd2955c7b5e5730db3f2716616..fb1ed4ab8f3ee60bbbdb4589f07e3f9ad0959a04 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * font-lock.el (font-lock-fontify-syntactic-keywords-region):
+       Make sure we stop when we reach the limit.
+
        * progmodes/sh-script.el (sh-font-lock-quoted-subshell): ' inside
        a "..." does not quote anything.
 
index 9c1775b25cbf09d6b05a6a46bb59d1dfff9925dd..ccbf09b75ea85256aa7e52bd60cbc9ee9d66ce32 100644 (file)
@@ -1473,9 +1473,10 @@ START should be at the beginning of a line."
       ;; Find an occurrence of `matcher' from `start' to `end'.
       (setq keyword (car keywords) matcher (car keyword))
       (goto-char start)
-      (while (if (stringp matcher)
-                (re-search-forward matcher end t)
-              (funcall matcher end))
+      (while (and (< (point) end)
+                  (if (stringp matcher)
+                      (re-search-forward matcher end t)
+                    (funcall matcher end)))
        ;; Apply each highlight to this instance of `matcher', which may be
        ;; specific highlights or more keywords anchored to `matcher'.
        (setq highlights (cdr keyword))