From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: html, css, and js modes working together Date: Tue, 7 Feb 2017 00:51:22 +0100 Message-ID: References: <87o9ynarz3.fsf@tromey.com> <87fujs80fk.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c0d0d6077a6630547e55130 X-Trace: blaine.gmane.org 1486425187 15683 195.159.176.226 (6 Feb 2017 23:53:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 23:53:07 +0000 (UTC) Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 00:53:01 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cat5f-0003ha-Du for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2017 00:52:59 +0100 Original-Received: from localhost ([::1]:51211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cat5l-0005VZ-5b for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 18:53:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cat4s-0005UF-CK for emacs-devel@gnu.org; Mon, 06 Feb 2017 18:52:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cat4o-0005Dk-Jh for emacs-devel@gnu.org; Mon, 06 Feb 2017 18:52:10 -0500 Original-Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:34994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cat4o-0005Bp-7U for emacs-devel@gnu.org; Mon, 06 Feb 2017 18:52:06 -0500 Original-Received: by mail-wr0-x235.google.com with SMTP id 89so29362361wrr.2 for ; Mon, 06 Feb 2017 15:52:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=W49YEJ6C+Tp4I+IdgnUSATOJ5s+0irDeOQh/mYa/njI=; b=eAOMKiGXmtGMibODassv+9iFrzDi6cEChAqXf8zsDjmJTkVnbn/6Ua8nEEflsQZqyd 39KeGnUjpzJx4+ocs0pk0dHuWXgFwoj6qHJnwoNkJyNbabngN15YGIH0S6y9s9oyWOGl VKXbanWlVh95WfKrTiCrX4c/fbigs0iwIV3UJNhsWjoZTMEoVCQPsFaNg0OfAjxg9eBT IarEO9drwNFzpsNnuzfSqb5iGoQF9E6MC9AjjinUa1ZX/1JuCtm/mcJvzy/ofkcqxfvt 3GmL7AW7NzrpSHcABpNBaUfIKpM4W9EHlwPROg/Y+YACTlpohWk29O6NllmQ3UMMtiio mwkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=W49YEJ6C+Tp4I+IdgnUSATOJ5s+0irDeOQh/mYa/njI=; b=G5ndPCXPIL46ItRE8JYG7unnMjeDVfw+SJ99W3Pm7LKekDQHseCzaE+ZCeP/4EWi2Z 4queOfHKNNwA1kERkYxB606uMQp+haI1IyhO/bxvAKhKfOjWH28JPGDCuxq2mZNOA7YA 3Peb6E1GSu9XlOnBVemrQOmphQq4QUQ2uuwcRiGWvFspCyLNsywAXn9uxqFNJLaq5CJA fB3U44Fo1icF0zgTeWnz2PzKcUf1zRsNL7qzf/IWCltl91UGWJSZv1fzFdN+PWtw5iZA SSOt7rcTNY5imlU6z+X3u2CDT6xZW5l1/IwXddZ0UwdnsQ6YnjWA7QsQ2VsJ0e6RTSpq 7OyQ== X-Gm-Message-State: AIkVDXKJCIy5urb6kGIZ4vcnkGO745QlNgoUaljk1x69xotFDnbg34GCq3EFH5sQf3kpaHnSmuRzjQbPzaCzDA== X-Received: by 10.223.133.98 with SMTP id 89mr11149927wrh.200.1486425123429; Mon, 06 Feb 2017 15:52:03 -0800 (PST) Original-Received: by 10.80.138.216 with HTTP; Mon, 6 Feb 2017 15:51:22 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c0c::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212068 Archived-At: --94eb2c0d0d6077a6630547e55130 Content-Type: text/plain; charset=UTF-8 On Mon, Feb 6, 2017 at 3:17 PM, Stefan Monnier 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.) --94eb2c0d0d6077a6630547e55130 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On M= on, Feb 6, 2017 at 3:17 PM, Stefan Monnier <monnier@iro.umontreal.c= a> wrote:
>> I'm not sure what you're referrin= g to here.=C2=A0 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 wor= k
>> 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 w= e
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 c= alling
> syntax-ppss while a different syntax table is in effect.

BTW, the better solution might be to extend syntax.el to provide som= e
hooks for that.=C2=A0 Not sure what's the best functionality to export,= but
maybe a good solution is a way to manage several caches.=C2=A0 Or maybe we<= br> 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.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


Excuse me for not taking part here= , but I simply do not have time now. As you probably know I tried to do the= se 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 t= hat basic functions which are used in simple language parsing in Emacs can&= #39;t easily be restricted to a region. At least not as far as I can see. I= f I am right these basic functions (in C) must be enhanced to allow this. I= f that is done then MuMaMo can do the work. (With some fixes now I guess fo= r changes at the elisp level which I have not had time to do.)
<= div class=3D"gmail-yj6qo">
<= /div>
--94eb2c0d0d6077a6630547e55130--