From 5a7380aa271da0b38c387b14328bb5bb902efb01 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 31 Mar 2015 09:35:42 -0400 Subject: [PATCH] * lisp/jit-lock.el (jit-lock--run-functions): Fix min/max copy&paste error. --- lisp/ChangeLog | 2 ++ lisp/jit-lock.el | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e50c69b8af4..df66d81f808 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2015-03-31 Stefan Monnier + * jit-lock.el (jit-lock--run-functions): Fix min/max copy&paste error. + Let jit-lock know the result of font-lock-extend-region-functions. * jit-lock.el (jit-lock--run-functions): New function. (jit-lock-fontify-now): Use it. Handle fontification bounds more diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 5fe2232f0bc..0faabeb879a 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -369,8 +369,8 @@ is active." ;; already run to avoid running them redundantly when we get to ;; those chunks. (setq tight-beg (max (or tight-beg (point-min)) this-beg)) - (setq tight-end (max (or tight-end (point-max)) this-end)) - (setq loose-beg (max loose-beg this-beg)) + (setq tight-end (min (or tight-end (point-max)) this-end)) + (setq loose-beg (min loose-beg this-beg)) (setq loose-end (max loose-end this-end)) nil))) `(,(min tight-beg beg) ,(max tight-end end) ,loose-beg ,loose-end))) @@ -417,7 +417,8 @@ Defaults to the whole buffer. END can be out of bounds." (quit (put-text-property start next 'fontified nil) (signal (car err) (cdr err)))))) - ;; In case we fontified more than requested, take note. + ;; In case we fontified more than requested, take advantage of the + ;; good news. (when (or (< tight-beg start) (> tight-end next)) (put-text-property tight-beg tight-end 'fontified t)) -- 2.11.4.GIT