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: Sat, 11 Feb 2017 10:46:16 -0700 Message-ID: <87efz44o47.fsf@tromey.com> References: <87o9ynarz3.fsf@tromey.com> <877f4z6i8n.fsf@tromey.com> <87poipzr0l.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486835233 26448 195.159.176.226 (11 Feb 2017 17:47:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Feb 2017 17:47:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux) Cc: Tom Tromey , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 11 18:47:08 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 1ccblK-0006Sq-NJ for ged-emacs-devel@m.gmane.org; Sat, 11 Feb 2017 18:47:06 +0100 Original-Received: from localhost ([::1]:49107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccblQ-0003jl-AM for ged-emacs-devel@m.gmane.org; Sat, 11 Feb 2017 12:47:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccbkr-0003jV-1D for emacs-devel@gnu.org; Sat, 11 Feb 2017 12:46:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccbkn-0007fP-Sh for emacs-devel@gnu.org; Sat, 11 Feb 2017 12:46:37 -0500 Original-Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:47491) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ccbkn-0007fE-Ip for emacs-devel@gnu.org; Sat, 11 Feb 2017 12:46:33 -0500 Original-Received: (qmail 28646 invoked by uid 0); 11 Feb 2017 17:46:23 -0000 Original-Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy5.mail.unifiedlayer.com with SMTP; 11 Feb 2017 17:46:23 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id jVmH1u00R2f2jeq01VmLPv; Sat, 11 Feb 2017 10:46:23 -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=yo5kaP-xeBUNkhhEvXEA:9 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=m9tlNLV8njaaeRltJA/CNU2ALFuVwu6t6YnM3bePC1w=; b=m9RjWXVuRwiDI970FZj6Gnj+wW uT2hZSJqru8lO0a2bN/jdYq/dUw6QVrizjujV5suLLexCBk07LdH1H3Zh8JjMPTKP7t0xUUh5EBpI t0DR01k5ZO/gkLNCHQoiY1u2/; Original-Received: from 75-171-188-196.hlrn.qwest.net ([75.171.188.196]:50610 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1ccbkX-0000wX-KU; Sat, 11 Feb 2017 10:46:17 -0700 X-Attribution: Tom In-Reply-To: (Stefan Monnier's message of "Fri, 10 Feb 2017 18:45:52 -0500") 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: 75.171.188.196 X-Exim-ID: 1ccbkX-0000wX-KU X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-171-188-196.hlrn.qwest.net (bapiya) [75.171.188.196]:50610 X-Source-Auth: tom+tromey.com X-Email-Count: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 67.222.38.55 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:212235 Archived-At: >>>>> "Stefan" == Stefan Monnier writes: Stefan> To keep `html-mode` as the dispatch function for the various options Stefan> (there's web-mode, mumamo's xhtml-mode, psgaml-mode, nxml-mode, ...). The way I see it is that Emacs should come with something reasonable out of the box. Disabling a feature because it might cause difficulty for some other mode that isn't in-tree is both a disservice to users (the default Emacs is missing a useful feature) and a maintenance problem (who knows what else is out there). Also, concretely speaking, these modes will have an easy time adapting. In particular the new mode sets 4 local variables: (setq-local indent-line-function #'mhtml-indent-line) (setq-local parse-sexp-lookup-properties t) (setq-local syntax-propertize-function #'mhtml-syntax-propertize) (setq-local font-lock-fontify-region-function #'mhtml--submode-fontify-region) ... so all some other deriving mode would have to do is reset these (and maybe not even parse-sexp-lookup-properties, since it's harmless). As for hooking in to auto-mode-alist or whatever, there are already ok approaches to this, I think. web-mode or the like can either prepend an entry to auto-mode-alist, or even fset html-mode to point to their mode function. (web-mode in particular is funny because it tries to do everything; so I suppose in theory if html-mode must be subjected to alternatives, so should js-, css-, ... whatever web-mode adds next.) Tom