diff lisp/packages/font-lock.el @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 0293115a14e9
children 441bb1e64a06
line wrap: on
line diff
--- a/lisp/packages/font-lock.el	Mon Aug 13 08:49:44 2007 +0200
+++ b/lisp/packages/font-lock.el	Mon Aug 13 08:50:05 2007 +0200
@@ -1158,9 +1158,10 @@
 	;; 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))