unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: 13542@debbugs.gnu.org
Subject: bug#13542: 24.3.50; args-out-of-range in jit-lock-fontify-now
Date: Thu, 24 Jan 2013 14:27:32 -0500	[thread overview]
Message-ID: <87mwvyxty3.fsf@gmail.com> (raw)


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





             reply	other threads:[~2013-01-24 19:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 19:27 Aaron Ecay [this message]
2013-01-30 17:06 ` bug#13542: 24.3.50; args-out-of-range in jit-lock-fontify-now Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwvyxty3.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=13542@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).