[Top][All Lists]

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

Re: "Font-lock is limited to text matching" is a myth

From: Stefan Monnier
Subject: Re: "Font-lock is limited to text matching" is a myth
Date: Mon, 10 Aug 2009 23:33:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> I think Daniel suggested that it is a frame-work that can be used for
> book-keeping of how far parsing has gone (the state must be kept
> elsewhere) and parsing while Emacs is idle.  Don't you think it can be
> used for that?

As it stands, it's not really adapted to it.
I mean, it's OK and there's worse, but it's not great.  It's designed
mostly to keep track of what has been highlighted (without paying too
much attention to potential dependencies between chunks), and it is
designed to rehighlight the parts that change and that are displayed.

For parsing, we generally assume sequential dependencies (e.g. can't
parse the end of the buffer before parsing the beginning), so
font-lock's tracking is not very well adapted.  And parsing may need to
be applied to chunks of text that has not yet and will never
be displayed.

Basically font-lock-syntactic-keywords is the part of font-lock that was
"designed" to handle the parsing side (together with syntax-table), but
it deserves to be improved significantly and it should be moved out of
font-lock since it provides services that are useful/needed by many
other packages, and in buffers where font-lock might not even
be desired.


reply via email to

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