[Top][All Lists]

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

Re: web-mode.el

From: Lennart Borgman
Subject: Re: web-mode.el
Date: Thu, 14 Jun 2012 03:49:49 +0200

On Thu, Jun 14, 2012 at 2:33 AM, Dmitry Gutov <address@hidden> wrote:
> Lennart Borgman <address@hidden> writes:
> > However it might not be worth the trouble. The real problem lies in
> > the Emacs C core. Parsing functions can currently not be stopped from
> > parsing things outside of the major mode chunk they belong too.
> > (mumamo.el goes a long way to try to address this problems as far as
> > possible. That makes the code quite complicated. A rewrite of the C
> > core makes things very simple. In addition to this rewrite of the
> > scheduling functions to add suitable tools for handling chunk finding
> > might be necessary, but that is much simpler.)=C2=A7
> From what I know, mmm-mode counteracts this problem effectively enough,
> narrowing buffer to chunks during fontification, binding
> font-lock-dont-widen to t, etc.

I am afraid that is a total misunderstanding. Narrowing etc does not
help because it does not affect all the functions involved.

> Anyway, you've seen the list of my immediate gripes about how MuMaMo
> works for ERB, and I'm inclined to fault chunk detection

Chunk detection must logically be done from the start of the file. In
the first version of MuMaMo I tried to do chunk detection from
anywhere in the file. That worked for simple cases but not for more
complicated cases so I rewrote this several years ago.

I have no idea about what trouble you have had. Perhaps you could
describe them? (Maybe there are still pieces of code I have forgotten
to rewrite?)

> and indentation logic in your code

Indentation is surpricingly hard actually. One problem is that you
have to do some language specific parsing (which the major mode
normally does). Another problem is getting this to work with chunks
and across chunks. There are several alternatives for this in
mumamo.el - and unfortunately I think there might some trouble there.

I suspect you have been looking at some of the easier cases. Please
take a look at the test cases. There should be more, but I think I
have written test cases for some of the troublesome cases.

> rather than facilities provided by Emacs.

See my first comment above.

reply via email to

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