emacs-devel
[Top][All Lists]
Advanced

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

Re: html, css, and js modes working together


From: Lennart Borgman
Subject: Re: html, css, and js modes working together
Date: Tue, 7 Feb 2017 00:51:22 +0100

On Mon, Feb 6, 2017 at 3:17 PM, Stefan Monnier <address@hidden> wrote:
>> I'm not sure what you're referring to here.  Do some of the existing
>> mixed mode things piggyback on the existing html mode?
> Both https://github.com/purcell/mmm-mode/ and
> https://github.com/vspinu/polymode/ do.

BTW: any chance to see some of those in elpa.git some day?

>> 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
>> work.

What Dmitry is saying is that it's OK to define an ad-hoc multi-mode for
html+css+js (after all, they're all part of the HTML standard, oh and we
should also add SVG in there), but it should be structured as a separate
mode on top of html-mode, css-mode, and js-mode.

> That seems orthogonal to the possibility of breaking the cache after calling
> syntax-ppss while a different syntax table is in effect.

BTW, the better solution might be to extend syntax.el to provide some
hooks for that.  Not sure what's the best functionality to export, but
maybe a good solution is a way to manage several caches.  Or maybe we
can just have syntax-propertize-function place ad-hoc cache entries
(via some new syntax-ppss-add-to-cache function) at every
major-mode boundary.


        Stefan


Excuse me for not taking part here, but I simply do not have time now. As you probably know I tried to do these things in MuMaMo (part of nXhtml). Unfortunately I found that it can not be done without some rather deep changes to Emacs.

The problem is that basic functions which are used in simple language parsing in Emacs can't easily be restricted to a region. At least not as far as I can see. If I am right these basic functions (in C) must be enhanced to allow this. If that is done then MuMaMo can do the work. (With some fixes now I guess for changes at the elisp level which I have not had time to do.)

reply via email to

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