emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: jit-lock called at EOB?


From: Kim F. Storm
Subject: Re: jit-lock called at EOB?
Date: Fri, 29 Sep 2006 13:18:40 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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 <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]