GNU bug report logs -
#13542
24.3.50; args-out-of-range in jit-lock-fontify-now
Previous Next
Reported by: Aaron Ecay <aaronecay <at> gmail.com>
Date: Thu, 24 Jan 2013 19:28:02 UTC
Severity: normal
Found in version 24.3.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 13542 <at> debbugs.gnu.org (full text, mbox):
> The issue is that the min value for the region to be fontified is
> calculated with the buffer temporarily widened (by the function
> ‘jit-lock-stealth-chunk-start’), but ‘jit-lock-fontify-now’ does not
> widen the buffer.
That's a left over from the 2002-10-01 change that decided that jit-lock
should not widen. I've installed the patch below which should fix
the problem.
Stefan
=== modified file 'lisp/jit-lock.el'
--- lisp/jit-lock.el 2013-01-13 01:23:48 +0000
+++ lisp/jit-lock.el 2013-01-30 16:59:53 +0000
@@ -439,8 +435,6 @@
Value is nil if there is nothing more to fontify."
(if (zerop (buffer-size))
nil
- (save-restriction
- (widen)
(let* ((next (text-property-not-all around (point-max) 'fontified t))
(prev (previous-single-property-change around 'fontified))
(prop (get-text-property (max (point-min) (1- around))
@@ -473,7 +467,7 @@
((null next) start)
((< (- around start) (- next around)) start)
(t next))))
- result))))
+ result)))
(defun jit-lock-stealth-fontify (&optional repeat)
"Fontify buffers stealthily.
@@ -564,6 +558,8 @@
(when jit-lock-context-unfontify-pos
;; (message "Jit-Context %s" (buffer-name))
(save-restriction
+ ;; Don't be blindsided by narrowing that starts in the middle
+ ;; of a jit-lock-defer-multiline.
(widen)
(when (and (>= jit-lock-context-unfontify-pos (point-min))
(< jit-lock-context-unfontify-pos (point-max)))
This bug report was last modified 12 years and 177 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.