emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: perl mode color highlighting working badly


From: Stefan Monnier
Subject: Re: perl mode color highlighting working badly
Date: Thu, 13 Oct 2005 10:33:27 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> When

> foo
> ---
> ba

> is fontified you have two choices: (a) Don't set a multiline property,
> or (b) set a property from `foo' till - in the worst case - the end of
> the buffer.  With (a) neither font-lock nor jit-lock will handle this.
> I have not seen an application using (b) yet.

As mentioned, I'd need something more concrete to be able to make a useful
comment on that.  Otherwise I'd just tell you to go look at the places that
use font-lock-multiline.

> Once set in a buffer `font-lock-syntactically-fontified' is never reset
> to a lower position.  It's all contained in the following piece of code:

>    (when (and font-lock-syntactically-fontified
>            (< font-lock-syntactically-fontified start))
>      (setq start (max font-lock-syntactically-fontified (point-min)))
>      (setq font-lock-syntactically-fontified end))

> Suppose `font-lock-syntactically-fontified' equals N in the current
> buffer.  If you now insert a larger stretch of code at any position
> before N you rely on font-lock to investigate the entire inserted code
> in its syntactic keyword pass.  With pure font-lock this is done in
> `font-lock-after-change-function'.  With jit-lock this is not done for
> those parts of the inserted code that are not displayed in a window.

jit-lock-context-* does this.  It's the reason why jit-lock-after-change
sets jit-lock-context-unfontify-pos to `start' rather than to `end'.


        Stefan




reply via email to

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