aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-05-11 15:55:16 +0000
committerStefan Monnier2005-05-11 15:55:16 +0000
commitb71813cb9a4a74f5b2e06e50b0782cb7223f2045 (patch)
treed81d54e90075b4802d917bfe8a20a5c1cb250f3b
parentcc9442f21ff1b08973c311467976154b210a457a (diff)
downloademacs-b71813cb9a4a74f5b2e06e50b0782cb7223f2045.tar.gz
emacs-b71813cb9a4a74f5b2e06e50b0782cb7223f2045.zip
(font-lock-fontify-keywords-region): Use a marker
when trying to ensure forward progress.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/font-lock.el13
2 files changed, 15 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c483fefaefb..1ff0edac77f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12005-05-11 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * font-lock.el (font-lock-fontify-keywords-region): Use a marker
4 when trying to ensure forward progress.
5
12005-05-11 Chong Yidong <cyd@stupidchicken.com> 62005-05-11 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * mouse-sel.el (mouse-sel-follow-link-p): New function. 8 * mouse-sel.el (mouse-sel-follow-link-p): New function.
@@ -18,8 +23,8 @@
18 (ada-mode): Add ada-adjust-case-skeleton to skeleton-end-hook. 23 (ada-mode): Add ada-adjust-case-skeleton to skeleton-end-hook.
19 24
20 * progmodes/ada-stmt.el (ada-adjust-case-skeleton): 25 * progmodes/ada-stmt.el (ada-adjust-case-skeleton):
21 Moved to ada-mode.el. 26 Move to ada-mode.el.
22 (ada-stmt-mode-hook): Deleted; do the work in ada-mode. 27 (ada-stmt-mode-hook): Delete; do the work in ada-mode.
23 28
24 * cus-edit.el (custom-file): Call file-chase-links. 29 * cus-edit.el (custom-file): Call file-chase-links.
25 30
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index d2ffdf44bdb..bd0af57059f 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1420,6 +1420,7 @@ LOUDLY, if non-nil, allows progress-meter bar."
1420 (let ((case-fold-search font-lock-keywords-case-fold-search) 1420 (let ((case-fold-search font-lock-keywords-case-fold-search)
1421 (keywords (cddr font-lock-keywords)) 1421 (keywords (cddr font-lock-keywords))
1422 (bufname (buffer-name)) (count 0) 1422 (bufname (buffer-name)) (count 0)
1423 (pos (make-marker))
1423 keyword matcher highlights) 1424 keyword matcher highlights)
1424 ;; 1425 ;;
1425 ;; Fontify each item in `font-lock-keywords' from `start' to `end'. 1426 ;; Fontify each item in `font-lock-keywords' from `start' to `end'.
@@ -1454,12 +1455,14 @@ LOUDLY, if non-nil, allows progress-meter bar."
1454 (while highlights 1455 (while highlights
1455 (if (numberp (car (car highlights))) 1456 (if (numberp (car (car highlights)))
1456 (font-lock-apply-highlight (car highlights)) 1457 (font-lock-apply-highlight (car highlights))
1457 (let ((pos (point))) 1458 (set-marker pos (point))
1458 (font-lock-fontify-anchored-keywords (car highlights) end) 1459 (font-lock-fontify-anchored-keywords (car highlights) end)
1459 ;; Ensure forward progress. 1460 ;; Ensure forward progress. `pos' is a marker because anchored
1460 (if (< (point) pos) (goto-char pos)))) 1461 ;; keyword may add/delete text (this happens e.g. in grep.el).
1462 (if (< (point) pos) (goto-char pos)))
1461 (setq highlights (cdr highlights)))) 1463 (setq highlights (cdr highlights))))
1462 (setq keywords (cdr keywords))))) 1464 (setq keywords (cdr keywords)))
1465 (set-marker pos nil)))
1463 1466
1464;;; End of Keyword regexp fontification functions. 1467;;; End of Keyword regexp fontification functions.
1465 1468