emacs-devel
[Top][All Lists]
Advanced

[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: Tue, 19 Jun 2012 03:56:53 +0200

On Tue, Jun 19, 2012 at 3:18 AM, Dmitry Gutov <address@hidden> wrote:
>
> What if the difference between mumamo-depth of pre-pre chunk and this one is
> 1 or -1, can you indent correctly in this case? If so, why the difference of
> 0 is a special case? Is this just a speed optimization?

Yes, 0 is a special case. All chunks that "belongs to" the main major
mode (this could be for example html-mode) in the file has
mumamo-depth 0. Sub-chunks (for example a js or css chunk) has
mumamo-depth 1, i.e. 0+1.

The sub-chunks could themselves have sub-chunks which then have a +1
greater mumamo-depth.

If a pre-pre chunk has the same depth as this one then the code in
this one could be a continuation of the code in the pre-pre chunk.
(This could be the case in for example a file which html+php code.) So
the user probably expects those chunks to be indented together.


>> That is because it is a full parser. I think we will see more such
>> examples now that CEDET is finally inside Emacs.
>
>
> As long as we don't try to use js2-mode as primary mode, the "full parser"
> thing won't be a problem, since it respects narrowing.

That is nice, but we can't always expect it to work that way. At least not yet.


>> Yes, I was trying to answer that. The reason it fails is because
>> nxml-mode (like js2-mode) contains a full parser. I have been thinking
>> that rewriting it is very difficult, but maybe Stefan's proposal (the
>> change to "syntax-ppss") is a  rather easy road.
>
>
> I don't think this changes much for nxml-mode: it uses the parser from
> xmltok.el, which doesn't employ any of the -sexp commands.

I thought that parser perhaps could use the -sexp commands for testing.



reply via email to

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