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: martin rudalics
Subject: Re: perl mode color highlighting working badly
Date: Fri, 14 Oct 2005 12:01:49 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> And as mentioned above, if font-lock is turned off the same parsing function
> will equally be unable to rely on the syntax-table properties.  So the only
> situation where the problem cannot be reproduced without jit-lock is when
> this parsing function is only used in font-lock and when it parses text past
> the displayed text.  I don't know of any such case.
>

Why turn off font-lock?  I need it to assign syntax properties.  And I
might want C-M-f on the last lines of a window do the right thing with
`parse-sexp-lookup-properties' non-nil.

> Indeed.  I've mentioned already a few times that the functionality offered
> by font-lock-syntactic-keywords should be added to syntax.el (which means
> make it independent from font-lock) after which font-lock-syntactic-keywords
> can be made obsolete.  We'll also probably need a way for this new
> functionality to be triggered from scan-sexps, but that can come later.
> And of course, this new functionality should ideally be a bit more
> flexible/powerful than font-lock-syntactic-keywords so that the job done by
> perl-font-lock-syntactic-face-function can be conveniently done there.
>

I fully agree.

>>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'.
>

`jit-lock-context-*' just resets the fontified property from `start'
until `point-max'.  If `start' is before `window-start' redisplay won't
bother - the syntactic keyword pass will begin at `window-start' anyway.
Syntax properties between `start' and `window-start' are not assigned.
Hence, jit-lock guarantees syntax-properties only between `window-start'
and `window-end'.





reply via email to

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