From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: html, css, and js modes working together Date: Sun, 05 Feb 2017 20:26:07 -0700 Message-ID: <87fujs80fk.fsf@tromey.com> References: <87o9ynarz3.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486351703 30228 195.159.176.226 (6 Feb 2017 03:28:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 6 Feb 2017 03:28:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux) Cc: Tom Tromey , Emacs discussions To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 06 04:28:15 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 1caZyP-0007Sh-Qs for ged-emacs-devel@m.gmane.org; Mon, 06 Feb 2017 04:28:14 +0100 Original-Received: from localhost ([::1]:45381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caZyV-0002OI-5q for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 22:28:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caZwg-0001bV-IL for emacs-devel@gnu.org; Sun, 05 Feb 2017 22:26:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caZwd-0004AX-Eg for emacs-devel@gnu.org; Sun, 05 Feb 2017 22:26:26 -0500 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:32882) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1caZwd-00049O-0J for emacs-devel@gnu.org; Sun, 05 Feb 2017 22:26:23 -0500 Original-Received: (qmail 21523 invoked by uid 0); 6 Feb 2017 03:26:17 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy6.mail.unifiedlayer.com with SMTP; 6 Feb 2017 03:26:16 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id hFSA1u0082f2jeq01FSDCi; Sun, 05 Feb 2017 20:26:16 -0700 X-Authority-Analysis: v=2.1 cv=Pets2ERd c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=n2v9WMKugxEA:10 a=vaJtXVxTAAAA:8 a=F9al7enfs4JdSBQI114A:9 a=hCt-GehETBxEYQOojhlW:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tSkMTHFovQLm4w/fX6uFq3gAAnjynTiAk4WiAEWxKTU=; b=XZl277KRMMwMpPaIUXiaG3JAoV fDAInt3DNt9U+XJVNoPMJ36mBDRZPyAgovExR+iakXPKambLMt0PHKQkXZyscDeYJQAv5/g0zwOk2 8/qdKx0j/UiEXBpAwh+t8IlEu; Original-Received: from 174-16-146-181.hlrn.qwest.net ([174.16.146.181]:59526 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1caZwP-0004jO-Mj; Sun, 05 Feb 2017 20:26:09 -0700 X-Attribution: Tom In-Reply-To: (Dmitry Gutov's message of "Mon, 6 Feb 2017 05:08:05 +0200") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.146.181 X-Exim-ID: 1caZwP-0004jO-Mj X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-146-181.hlrn.qwest.net (bapiya) [174.16.146.181]:59526 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 67.222.39.168 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:212015 Archived-At: >>>>> "Dmitry" == Dmitry Gutov 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 work. 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 helpful. Tom