From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: html, css, and js modes working together Date: Sun, 12 Feb 2017 18:20:16 +0200 Message-ID: References: <87o9ynarz3.fsf@tromey.com> <877f4z6i8n.fsf@tromey.com> <87poipzr0l.fsf@tromey.com> <87efz44o47.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1486916473 22563 195.159.176.226 (12 Feb 2017 16:21:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2017 16:21:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 Cc: emacs-devel@gnu.org To: Tom Tromey , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 12 17:21:09 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 1ccwtg-0005bx-5r for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2017 17:21:08 +0100 Original-Received: from localhost ([::1]:52580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccwtl-0004R0-TD for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2017 11:21:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ccwsy-0004Qk-CB for emacs-devel@gnu.org; Sun, 12 Feb 2017 11:20:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ccwst-0002yW-EJ for emacs-devel@gnu.org; Sun, 12 Feb 2017 11:20:24 -0500 Original-Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ccwst-0002yO-7m for emacs-devel@gnu.org; Sun, 12 Feb 2017 11:20:19 -0500 Original-Received: by mail-wr0-x242.google.com with SMTP id i10so20710881wrb.0 for ; Sun, 12 Feb 2017 08:20:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Mv4Aynt+fnyewIODw++9C11vvPdwnktAUPt2jTvHvDo=; b=ceJyg7ufQxCFvF9DdUpMK/ETq8iLJuhVKLZfjFH3+6x+jE49SwoipJDb8ZVYkyMx5E UpIPCzSRhvtm2bBO28IiSotcscJ1BMvY5TZkds5LAagyY0hyKh7x3KNiS4l9yo/wxTpw PBUvYWoPn2PSCMOkeWulY2Dj26B/wf5/oTUG28KhkmxupIXElxo/elKigKMo2AK4GL2k mIcFeNXUdJYAyu/uP/rEuUFazEqk6vp8Gcsg7ZfMPzU4PKKoGBbAv3IROFl8wHdw5Fma i7xAxxUB6JuUYSISmJ7S8+W/i2ECBdlioIDcazsOLgqswdxndqDBjb0UQxsMFhDuS6zV MSgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Mv4Aynt+fnyewIODw++9C11vvPdwnktAUPt2jTvHvDo=; b=pjfZOcYzyQp2IqUD55h20c+jq4jea0vUG5Wjc6M5rvx5BjxlMPbEpjRblqMCm5gEgI B12tPvwiNSiL3OjzEXlq9NjJCRfPnhDTlxIFtEXJ9IXsCWIXKyMN1AA2fjbbscqZlltQ MuZuDA/R+FdkN+1v4LvUMD8LfS7clxsDCc8/eeBp9QrR3fWuvubiz7Ncxh1gGvcOujQe pKTgQP0BJbP0mZA9owPbhfAQ/eU5uPakfn44ribijSi0Dz1jtb/0RWn3Gjykm3ja6ZuO zxegPd1sLkf0wOFj6omKnfx/fczVYMBpr/a1FWPkpP70lH4m8nVkoPXmqRJtlBfIR5Wo ZY9Q== X-Gm-Message-State: AMke39knFIORPf4KMchtk/BQP/ANXK9aVtGVanIN6Ln06EqZIWebsrASI0L0Xez6Rh/elA== X-Received: by 10.223.139.220 with SMTP id w28mr16408859wra.172.1486916418112; Sun, 12 Feb 2017 08:20:18 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id e74sm1905416wmd.2.2017.02.12.08.20.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 08:20:17 -0800 (PST) In-Reply-To: <87efz44o47.fsf@tromey.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c0c::242 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:212290 Archived-At: On 11.02.2017 19:46, Tom Tromey wrote: > 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). The default Emacs will have this feature if html-rich-mode is associated with *.html in auto-mode-alist. > 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). How does your buffer-locals approach work? In mmm-mode, you first call a major mode to get its values of indent-line-function and so on. Without them being available after calling html-mode, we'd have to hardcode an annoying amount of stuff, and become less resilient against renames.