aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-03-31 00:04:39 -0400
committerStefan Monnier2015-03-31 00:04:39 -0400
commit81b0eade25e57fc39f9ee75be3f5adef8af93035 (patch)
tree710c90d984d930d7ea2647a8448dba9ddaf1d929
parentbc9a6fcd29cd2e35a34e42f6e8b9492c98c1560f (diff)
downloademacs-81b0eade25e57fc39f9ee75be3f5adef8af93035.tar.gz
emacs-81b0eade25e57fc39f9ee75be3f5adef8af93035.zip
* jit-lock.el (jit-lock--run-functions): Do the `or' where it can be nil.
-rw-r--r--lisp/jit-lock.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index d271a447756..5fe2232f0bc 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -362,8 +362,14 @@ is active."
362 (`(,this-beg . ,this-end) 362 (`(,this-beg . ,this-end)
363 (if (eq (car-safe res) 'jit-lock-bounds) 363 (if (eq (car-safe res) 'jit-lock-bounds)
364 (cdr res) (cons beg end)))) 364 (cdr res) (cons beg end))))
365 (setq tight-beg (max tight-beg (or this-beg (point-min)))) 365 ;; If all functions don't fontify the same region, we currently
366 (setq tight-end (max tight-end (or this-end (point-max)))) 366 ;; just try to "still be correct". But we could go further and for
367 ;; the chunks of text that was fontified by some functions but not
368 ;; all, we could add text-properties indicating which functions were
369 ;; already run to avoid running them redundantly when we get to
370 ;; those chunks.
371 (setq tight-beg (max (or tight-beg (point-min)) this-beg))
372 (setq tight-end (max (or tight-end (point-max)) this-end))
367 (setq loose-beg (max loose-beg this-beg)) 373 (setq loose-beg (max loose-beg this-beg))
368 (setq loose-end (max loose-end this-end)) 374 (setq loose-end (max loose-end this-end))
369 nil))) 375 nil)))
@@ -402,7 +408,7 @@ Defaults to the whole buffer. END can be out of bounds."
402 ;; `tight' is the part we've fully refontified, and `loose' 408 ;; `tight' is the part we've fully refontified, and `loose'
403 ;; is the part we've partly refontified (some of the 409 ;; is the part we've partly refontified (some of the
404 ;; functions have refontified it but maybe not all). 410 ;; functions have refontified it but maybe not all).
405 ((`(,tight-beg ,tight-end ,loose-beg ,loose-end) 411 ((`(,tight-beg ,tight-end ,loose-beg ,_loose-end)
406 (condition-case err 412 (condition-case err
407 (jit-lock--run-functions start next) 413 (jit-lock--run-functions start next)
408 ;; If the user quits (which shouldn't happen in normal 414 ;; If the user quits (which shouldn't happen in normal