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: Thu, 13 Oct 2005 14:06:58 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

>     > jit-lock breaks font-lock's handling of syntax-table properties anyway.
>     > Having syntactic properties behave correctly only for positions
>     > preceding `font-lock-syntactically-fontified' means that I can't parse
>     > text after that position reliably with `parse-sexp-lookup-properties'
>     > non-nil.
>
>     But the same problem happens without jit-lock if you don't turn on
>     font-lock.
>
> How is this?  Would you please explain what this problem is?

font-lock uses `font-lock-fontify-buffer' to fontify the entire buffer
initially and `font-lock-after-change-function' to fontify any new text
inserted in the buffer.  Both guarantee that the syntactic keyword pass
is executed and syntactic properties assigned properly as described in
section 23.6.9 of the Elisp manual.

With jit-lock the syntactic keyword pass is executed only till the end
of the window showing the highest so far displayed position of the
buffer.  This means that a parsing function investigating text after
that position cannot rely on syntactic properties of the underlying
text.  Since jit-lock is turned on by default the manual should warn
about this.

>
>            Actually, in my experience, most/all the weird corner cases that
>     seem to be caused by jit-lock can be reproduced without jit-lock.
>
> Perhaps we should define a simple function that someone can call to
> update the syntax-table properties for a certain region.
>
>

`font-lock-fontify-syntactic-keywords-region' does that already.  But
for languages relying on syntax properties one would have to call that
function before every scan-sexps, parse-partial-sexp, skip-syntax ...





reply via email to

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