summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-01-19 16:19:07 +0000
committerGerd Moellmann <gerd@gnu.org>2001-01-19 16:19:07 +0000
commit9724173bef67aad346c9a25442b15423cc453cfc (patch)
treef1f7b9acfae072376601761b805ba4668cde20a5 /lisp/jit-lock.el
parentdc81f8a23b85278570cd29a7ef41d5293ad4716d (diff)
downloademacs-9724173bef67aad346c9a25442b15423cc453cfc.tar.gz
(jit-lock-fontify-now): Don't bind
font-lock-beginning-of-syntax-function to nil.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 04fd77893db..6b142997f5c 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -264,8 +264,15 @@ Defaults to the whole buffer. END can be out of bounds."
(widen)
(unless start (setq start (point-min)))
(setq end (if end (min end (point-max)) (point-max)))
- (let ((font-lock-beginning-of-syntax-function nil)
- next)
+ ;; This did bind `font-lock-beginning-of-syntax-function' to
+ ;; nil at some point, for an unknown reason. Don't do this; it
+ ;; can make highlighting slow due to expensive calls to
+ ;; `parse-partial-sexp' in function
+ ;; `font-lock-fontify-syntactically-region'. Example: paging
+ ;; from the end of a buffer to its start, can do repeated
+ ;; `parse-partial-sexp' starting from `point-min', which can
+ ;; take a long time in a large buffer.
+ (let (next)
(save-match-data
;; Fontify chunks beginning at START. The end of a
;; chunk is either `end', or the start of a region