unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13542: 24.3.50; args-out-of-range in jit-lock-fontify-now
@ 2013-01-24 19:27 Aaron Ecay
  2013-01-30 17:06 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Ecay @ 2013-01-24 19:27 UTC (permalink / raw)
  To: 13542


Related to the recent change to raise (as opposed to ignoring) errors
generated in timers, I have started seeing backtraces similar to the
following:

Debugger entered--Lisp error: (args-out-of-range 1 23)
  text-property-any(1 23 fontified t)
  jit-lock-fontify-now(1 501)
  jit-lock-stealth-fontify(t)
  apply(jit-lock-stealth-fontify t)
  byte-code("r\301^H\302H^H\303H\"\210)\301\207" [timer apply 5 6] 4)
  timer-event-handler([t 0 7 37086 nil jit-lock-stealth-fontify (t) idle
  943000])

This shows up (for example) in a message-mode buffer with some of the mail
headers hidden by narrowing.

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.

I think the solution is either:
1) add a (save-restriction (widen) ...) to jit-lock-fontify-now*
2) add (setq start (max start (point-min))) at line 357 of jit-lock.el

I don’t know enough about the fontification code to know which is
correct.  (But note that strategy 2 is used for the ‘end’ argument to
‘jit-lock-fontify-now’, also at line 357).

* If widening should be done in general when fontifying, perhaps the
‘with-buffer-prepared-for-jit-lock’ macro should do it.

Thanks,

-- 
Aaron Ecay





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-30 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-24 19:27 bug#13542: 24.3.50; args-out-of-range in jit-lock-fontify-now Aaron Ecay
2013-01-30 17:06 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).