[Top][All Lists]

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

Re: Why js2-mode in Emacs 23.2?

From: Lennart Borgman
Subject: Re: Why js2-mode in Emacs 23.2?
Date: Mon, 10 Aug 2009 02:55:25 +0200

On Mon, Aug 10, 2009 at 2:46 AM, Daniel Colascione<address@hidden> wrote:
> On Aug 9, 2009, at 8:17 PM, Lennart Borgman wrote:
>> Could not JIT-lock do a second pass?
>>> Is there another way to solve the problem? Can mumamo tell espresso to
>>> ignore certain parts of the buffer?
>> Well, it does, but espresso kind of ignores that ... ;-)
>> Just telling it where to scan will however not help since
>> espresso-mode will be called every time a user enters a chunk with
>> espresso-mode.
> A second pass when?

I see. It will not help here.

> The problem is that functions that have nothing to do
> with fontification operate improperly unless correct text properties are
> attached to certain bits of the buffer.

You can handle this by checking for fontification and do it when
necessary and tell JIT lock you have done it.

See mlinks.el in nXhtml for an example of how to do it. (Look in the
repository, I have just implemented this.)

Maybe you can take that functionality and makes it into a separate
library. I have not had time to do that but I think it would be good.

> Consider the regular expression /}/. syntactic-keywords are used to mark the
> whole expression as a string. If forward-sexp encounters that expression
> before the expression is marked as a string, then it'll interpret the '}'
> incorrectly. When the user actually enters a '}', we fontify it correctly.
> However, when we first start up, we need to fonyify the whole buffer so that
> we don't trip over
> one of these regular expressions if we look at it before jit-lock gets
> around to it.
> Can espresso just perform the regexp-marking scan 1) on only the region
> given to it by mumamo, and 2) only once, with some kind of indication given
> by mumamo of whether we're seen this particular chunk before?

I think the recipe above will work for mumamo too.

>>> As for define-derived-mode: nope, espresso-mode doesn't use that.
>> It is a minor change but will help keeping it upto date later.
> So just use define-derived-mode to inherit from fundamental-mode?

Yes. (Or from nil.)

reply via email to

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