unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Aaron Ecay <aaronecay@gmail.com>
Cc: 13542@debbugs.gnu.org
Subject: bug#13542: 24.3.50; args-out-of-range in jit-lock-fontify-now
Date: Wed, 30 Jan 2013 12:06:05 -0500	[thread overview]
Message-ID: <jwvfw1id2mb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87mwvyxty3.fsf@gmail.com> (Aaron Ecay's message of "Thu, 24 Jan 2013 14:27:32 -0500")

> 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)))






      reply	other threads:[~2013-01-30 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=jwvfw1id2mb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=13542@debbugs.gnu.org \
    --cc=aaronecay@gmail.com \
    /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).