[Top][All Lists]

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

Re: web-mode.el

From: Dmitry Gutov
Subject: Re: web-mode.el
Date: Sat, 16 Jun 2012 17:19:21 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 16.06.2012 5:43, Lennart Borgman wrote:
On Fri, Jun 15, 2012 at 5:24 AM, Dmitry Gutov <address@hidden> wrote:

Fully isolating the chunks might not be the best course of action, even if
it were not too hard to do.
For example, if we want to adjust indentation inside <% if %> <% end%>
blocks, we need to be able to actually look inside them while we're in the
primary mode chunk (between those two).

Can you give an example of what you mean here?

I was just arguing a general point. If your proposal was to be able to call various functions manually while lying to them or their callees, then go back to seeing the whole buffer "truly", this example doesn't apply.

As an aside, this bit from the docstring sounds not very useful, maybe even

"- However first non-empty line indentation in a chunk when going
in is special if prev-prev chunk is on same mumamo-depth and
have the same major mode. Then indent relative last non-empty
line in prev-prev chunk."

Why do you think this is wrong?

If mumamo-depth doesn't take into account nesting level of plain html tags, then this is going to be wrong when nesting levels are different.

If it does take into account those, this shouldn't be a problem, but I still don't understand why you need this mechanic at all.

js2-mode's indentation function is very similar to js-mode, since they're
both derived from an javascript-mode. It doesn't work in multi-mode context,
though, and while fixing that shouldn't be too hard, I'm not sure it's worth
spending time on, because js2-mode's advantages over js-mode are most
evident with larger files, not small snippets.

Is not this is a general problem, not something specific to js2-mode?

js2-mode is doing things differently from most major modes: 1) it reads all buffer contents, scanning through every buffer character one by one while parsing, 2) its fontification is all manual, performed by setting 'font-lock-face and 'syntax-table text properties during parsing. And parsing is scheduled directly from after-change-functions, not through jit-lock.

I have yet to look into using nxml as primary mode. Do you have any
suggestions how that could be made easier?

There are such multi major modes in nXhtml. However they does not
always behave as I expected.

I was asking specifically about nxml, because my initial attempt to make it work with erb-style tags in mmm-mode had failed.

reply via email to

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