all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: jit-lock called at EOB?
Date: Fri, 29 Sep 2006 13:18:40 +0200	[thread overview]
Message-ID: <m37izmkjjj.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <jwvirj8jchg.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu\, 28 Sep 2006 10\:30\:15 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> The recent problems of "looping in jit-lock / redisplay" seem to be caused
> by the fact that every redisplay will call jit-lock at EOB because the
> text-property value of `fontified' at EOB is always nil (this is because
> get-text-property treats requests at EOB specially: there is no char there,
> so there can't be a property either, but instead of signalling an error it
> returns nil).
>
> I've worked around this problem now in jit-lock by ignoring requests to
> fontify empty regions of text, but I believe the real bug is in the C code
> which shouldn't call jit-lock at all.  So I suggest the patch below.
>
> Any objection?

[Please ignore previous _incomplete_ message ...]

Looks good to me.

But I would write it like this, since there is no reason to
lookup the property at eob:


*** xdisp.c	20 Sep 2006 10:53:53 +0200	1.1122
--- xdisp.c	29 Sep 2006 13:15:14 +0200	
***************
*** 3244,3249 ****
--- 3244,3252 ----
        && it->s == NULL
        && !NILP (Vfontification_functions)
        && !NILP (Vrun_hooks)
+       /* Ignore the special cased nil value always present at EOB since
+ 	 no amount of fontifying will be able to change it.  */
+       && IT_CHARPOS (*it) < Z
        && (pos = make_number (IT_CHARPOS (*it)),
  	  prop = Fget_char_property (pos, Qfontified, Qnil),
  	  NILP (prop)))



>
> --- xdisp.c	22 sep 2006 11:15:42 -0400	1.1122
> +++ xdisp.c	28 sep 2006 10:28:50 -0400	
> @@ -3246,7 +3246,9 @@
>        && !NILP (Vrun_hooks)
>        && (pos = make_number (IT_CHARPOS (*it)),
>  	  prop = Fget_char_property (pos, Qfontified, Qnil),
> -	  NILP (prop)))
> +	  /* Ignore the special cased nil value always present at EOB since
> +	     no amount of fontifying will be able to change it.  */
> +	  NILP (prop) && IT_CHARPOS (*it) < Z))
>      {
>        int count = SPECPDL_INDEX ();
>        Lisp_Object val;

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2006-09-29 11:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28 14:30 jit-lock called at EOB? Stefan Monnier
2006-09-29 11:11 ` Kim F. Storm
2006-09-29 11:18 ` Kim F. Storm [this message]
2006-09-29 12:58   ` Stefan Monnier
2006-09-29 11:21 ` David Kastrup
2006-09-29 21:45   ` Richard Stallman
2006-09-30 13:30     ` Stefan Monnier
2006-09-29 16:33 ` Richard Stallman

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

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

  git send-email \
    --in-reply-to=m37izmkjjj.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.