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: Tue, 7 Feb 2017 13:28:38 +0200 Message-ID: References: <87o9ynarz3.fsf@tromey.com> <87zihy7jnk.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 1486466933 11054 195.159.176.226 (7 Feb 2017 11:28:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 7 Feb 2017 11:28:53 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 Cc: Emacs discussions To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 07 12:28:49 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 1cb3x2-0002dK-3x for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2017 12:28:48 +0100 Original-Received: from localhost ([::1]:53318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cb3x7-0003iI-Ok for ged-emacs-devel@m.gmane.org; Tue, 07 Feb 2017 06:28:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cb3x1-0003i2-1h for emacs-devel@gnu.org; Tue, 07 Feb 2017 06:28:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cb3wx-0008Rm-TD for emacs-devel@gnu.org; Tue, 07 Feb 2017 06:28:47 -0500 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:37440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cb3wx-0008RO-Lz for emacs-devel@gnu.org; Tue, 07 Feb 2017 06:28:43 -0500 Original-Received: by mail-wm0-x232.google.com with SMTP id v77so150231328wmv.0 for ; Tue, 07 Feb 2017 03:28:43 -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=jP15wjQKK3a4ngg3VHkzru623iJ6iQum5I2er0Te6qU=; b=bfS6GmRQPMGW07S0wbc+dITp79wPsAEKdQATgs5Tn05A507zg6xRZUVr/WsVvU2BgW tsu2bsUw9H2Dm8JLNnF9pzlJgALddVDr3Trbi1tE7tFDo9rR9udQeO5Cv1hoGAnphrCM HB0JmNNogmMR7TNqV0TbODccAtOuCVBAy0RQQ2i6sVAr8HEmsCqT6peM4ujGR3MxnMr8 uI3cUDDNdatckL/e8j4JmVbrFM73DEGPwpNRvw3mSW3LgtBLNevTUNImxXMIrt4S1+7W 2b7dwFqwovxHCvP4gq17sERss+3GWdSHW0gC9W297bclsA3VA6dZxw9ZAr0MrBOCPf1/ jSeQ== 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=jP15wjQKK3a4ngg3VHkzru623iJ6iQum5I2er0Te6qU=; b=DzVpyFWFbpIMJHB+/NW1e2kC+g195I6Ol5B/YiAvslNIiBxdOcaHYIqYm1KGPmNWsZ pl5Uod5VGLMiSrGTIzS57uMzKYN8mlV5ai40aX46hnI5zXckx7NP077RU+qGB6+Z8m3e aFz+0O1iVmytaDN9pkPiv4cIUr1GqozX5Gs/4hya9x5DRd1k/Xm0yAOjuf7ysGyEQXJj OMHTv8ciE43rWaqc5bkmf4lbxx9x9icZTmmP+qEBxTBY7DPUYDfW86G2pxyo6rJ8r3dT l+UHb3K03LEH5PHOC7VuwCBY2U00vyPHTYnAsiCnYG6ao//MILlYRaYVi8H5CwIL/bzp yM8g== X-Gm-Message-State: AMke39nICzuILghC8kskL0famsh+cU14XWFU/0Ej+k9MwyyMCMubOc17KJSgRyvC1ISl6Q== X-Received: by 10.28.62.144 with SMTP id l138mr11847373wma.50.1486466922161; Tue, 07 Feb 2017 03:28:42 -0800 (PST) Original-Received: from [192.168.1.3] ([185.105.173.41]) by smtp.googlemail.com with ESMTPSA id a72sm6773470wrc.48.2017.02.07.03.28.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 03:28:41 -0800 (PST) In-Reply-To: <87zihy7jnk.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:c09::232 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:212083 Archived-At: On 07.02.2017 05:40, Tom Tromey wrote: > Dmitry> It indents fine. Now try replacing "4" with "4 < 5" and reindenting > Dmitry> the "alert" line. It jumps to the right. > > I debugged this tonight. > > The problem here is that sgml-parse-tag-backward looks for "<" or ">" > characters, but doesn't consider the syntax. The appended patch fixes > this test case. It should work. But maybe another thing to try is avoid using sgml-get-context as the dispatch function for html-indent-line. After all, html-syntax-propertize-function already knows how to find the limits of the hunks. The method may change, but hopefully you'd be able to reuse it. It could also leave a text property (or some overlays) which the indentation function can look up. > My hope is that the html-syntax-propertize-function -- maybe not the one > I wrote but one that's been fixed according to the various comments in > this thread -- should suffice to fix all such problems in principle. I think so. IME adding syntax-table property on such `<` and `>` works well enough. And the main issue to look out for is indentation of HTML tags following the tags with such rogue < and > inside. > Something like this problem in sgml-parse-tag-backward doesn't > invalidate the scheme; this is just a buglet. What do you think? I agree, at least as far as this specific combination of modes in concerned. Things get complicated when we try to combine arbitrary modes.