diff lisp/packages/font-lock.el @ 96:dbb370e3c29e r20-0final

Import from CVS: tag r20-0final
author cvs
date Mon, 13 Aug 2007 09:12:40 +0200
parents 821dec489c24
children a145efe76779
line wrap: on
line diff
--- a/lisp/packages/font-lock.el	Mon Aug 13 09:12:11 2007 +0200
+++ b/lisp/packages/font-lock.el	Mon Aug 13 09:12:40 2007 +0200
@@ -1158,12 +1158,13 @@
 	;; 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))
+	  (setq highlights (cdr keyword))
 	(while highlights
 	  (if (numberp (car (car highlights)))
 	      (font-lock-apply-highlight (car highlights))