[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: Chong Yidong
Subject: Re: "Font-lock is limited to text matching" is a myth
Date: Tue, 11 Aug 2009 10:50:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Daniel Colascione <address@hidden> writes:

>> There is a relatively simple alternative that might appease Daniel:
>> I could have js2-mode simply not do any highlighting by default,
>> except for errors and warnings.  We'd use whatever highlighting is
>> provided by espresso-mode, and users would be able to choose between
>> espresso-highlighting and js2-mode highlighting.  With the former,
>> they'd get "instantaneous" font-locking, albeit not as rich as what
>> js2-mode can provide.
> That's an interesting idea, but my concerns are not limited to js2-
> mode's highlighting.

You don't properly elaborate what these additional concerns are.

I don't use either mode, but from reading the discussion it seems to me
that the optimal solution is to use espresso mode's code for font-lock
and indentation, and js2-mode's code for the commands that need to be
better aware of semantic information (show/hide elements, error
reporting, marking defuns, etc.)

> There is *already* a separate and optional full parsing framework
> called CEDET that is powerful, generic, and not tied to a major-mode
> in particular. The right approach is for a given major-mode to
> understand enough of a given language for fontification and
> indentation while leaving more substantial parsing and indexing to
> CEDET (which the user can disable). I recognize that js2's parser may
> work well in its problem domain --- couldn't it just be added to

I don't think this is a necessary condition.  We can freely move the
code around the Emacs tree once it's already in there; what's more
important is to have something working.

reply via email to

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