[Top][All Lists]

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

Re: html, css, and js modes working together

From: Tom Tromey
Subject: Re: html, css, and js modes working together
Date: Sun, 05 Feb 2017 20:26:07 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux)

>>>>> "Dmitry" == Dmitry Gutov <address@hidden> writes:

Just a quick reply to a couple of points.

Dmitry> I'm glad you are interested in the problem of mixed modes, but
Dmitry> implementing it inside html-mode is likely to make life more difficult
Dmitry> for the existing mixed-mode frameworks because now html-mode's
Dmitry> indentation code and font-lock rules are that much more complex.

I'm not sure what you're referring to here.  Do some of the existing
mixed mode things piggyback on the existing html mode?

I guess my view is that it is always ok to make things in-tree work
better with each other, even at the expense of some code that is
out-of-tree and presumably relying on implementation details to do its

Though I don't actually know any details... the one such mode I've used,
web-mode, reimplements everything on its own.

Dmitry> So far it's only used in python-mode, I think.

grep shows no users in-tree, so maybe this never went in?  Or is this
one of the various out-of-tree python modes?

>> * This work doesn't address the need for per-region font locking at all.

Dmitry> Not sure what you mean by that. But I've applied the patch, and I
Dmitry> don't see any JS or CSS specific highlighting. Indentation kinda
Dmitry> works, though.

Yeah, what I mean is that font-locking does not occur, but it would be
good to have.  I couldn't find anything saying how this might be solved.
I haven't come up with any really good ideas myself.  Maybe font-lock
could also look at text properties to decide what keywords to use?

Dmitry> - Both css-mode and js-mode call syntax-ppss in their indentation
Dmitry> code. Luckily, their syntax tables are fairly compatible. But
Dmitry> sgml-syntax-propertize-rules calls syntax-ppss as well.

I thought that a syntax-table property on the characters would make
syntax-ppss do the "right" thing; namely, notice where the syntax table
changes and change its parsing method accordingly.  This seems to be
what is implemented in syntax.c when parse-sexp-lookup-properties is
set... but I didn't dig through that code in detail so I am probably
misunderstanding somehow.

I didn't try your example yet.  Thanks for providing that, that's very


reply via email to

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