From: Stefan Monnier Date: Sun, 6 Mar 2005 00:02:04 +0000 (+0000) Subject: (font-lock-fontify-keywords-region): Ensure forward X-Git-Tag: ttn-vms-21-2-B4~1977 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=55d0f066bed360974ead168f70932cdd54c2ead6;p=emacs.git (font-lock-fontify-keywords-region): Ensure forward progress, even with buggy anchored keywords. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d65a446a376..f10a15936b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-03-05 Stefan Monnier + + * font-lock.el (font-lock-fontify-keywords-region): Ensure forward + progress, even with buggy anchored keywords. + 2005-03-05 Luc Teirlinck * simple.el (goto-line): Remove unbalanced final parenthesis. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 90d4aa0adeb..ceadcf19728 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1,7 +1,7 @@ ;;; font-lock.el --- Electric font lock mode ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -;; 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; 2000, 2001, 2002, 2003, 2004 2005 Free Software Foundation, Inc. ;; Author: jwz, then rms, then sm ;; Maintainer: FSF @@ -1425,7 +1425,10 @@ LOUDLY, if non-nil, allows progress-meter bar." (while highlights (if (numberp (car (car highlights))) (font-lock-apply-highlight (car highlights)) - (font-lock-fontify-anchored-keywords (car highlights) end)) + (let ((pos (point))) + (font-lock-fontify-anchored-keywords (car highlights) end) + ;; Ensure forward progress. + (if (< (point) pos) (goto-char pos)))) (setq highlights (cdr highlights)))) (setq keywords (cdr keywords)))))