From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: web-mode.el Date: Sat, 16 Jun 2012 12:55:41 +0200 Message-ID: References: <4FD9F40C.90406@yandex.ru> <4FDA927D.50306@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1339844188 29972 80.91.229.3 (16 Jun 2012 10:56:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2012 10:56:28 +0000 (UTC) Cc: cyd@gnu.org, emacs-devel@gnu.org, Dmitry Gutov To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 16 12:56:27 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sfqg5-0007we-AR for ged-emacs-devel@m.gmane.org; Sat, 16 Jun 2012 12:56:25 +0200 Original-Received: from localhost ([::1]:42635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfqg5-0004TF-3x for ged-emacs-devel@m.gmane.org; Sat, 16 Jun 2012 06:56:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfqg1-0004KH-LP for emacs-devel@gnu.org; Sat, 16 Jun 2012 06:56:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sfqg0-0001h2-0w for emacs-devel@gnu.org; Sat, 16 Jun 2012 06:56:21 -0400 Original-Received: from mail-wi0-f169.google.com ([209.85.212.169]:54217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfqfw-0001g5-91; Sat, 16 Jun 2012 06:56:16 -0400 Original-Received: by wibhn14 with SMTP id hn14so256514wib.0 for ; Sat, 16 Jun 2012 03:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=nxWFhRzs48ROC24FDciqBWAH3GHe9MAJn+d6eDquJqw=; b=nyDdOEmWM4q5jkfiI4C49JMsqYAg5i1crUPC7gjKg3ieGS/P22S+wErmVoZn9JT7jC zPCtAyHudiNgZdEOCjluMoii5Ia3lm+necuBIElkSadrjong0TvrD1hlz8O+bMJW7wRA nxx+HBc8c3k0OlmEktZA9fyGdhfO/gdISyT8eatgQ7yppLeEoEAmCCU0VkWuPEAON8JN MfjNuzuqDMuxYdm2GDCdQ8sbmmnAK7uAKpuG0LRz70/e+emj3nOUemZ0+lE+XHMessbr LMbTDBix3+D+Y9VqsPw0F7NEVvTNFZTWc3yVdWhlA0exZq7BD6BTMuFlrYli9qzRGgaf /rPg== Original-Received: by 10.216.194.95 with SMTP id l73mr4430468wen.206.1339844173139; Sat, 16 Jun 2012 03:56:13 -0700 (PDT) Original-Received: by 10.216.36.21 with HTTP; Sat, 16 Jun 2012 03:55:41 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150968 Archived-At: On Sat, Jun 16, 2012 at 8:17 AM, Stefan Monnier wrote: >>>> 2) sgml-indent-line calls sgml-parse-tag-backward, which does >>>> (re-search-backward "[<>]"), finds "<" and performs simple regexp chec= k. >>>> Thus,<% if a< =C2=A03 %> =C2=A0breaks indentation on following lines, = until first >>>> closing tag. >>> I think we can treat this as a bug in sgml-indent-line, which should tr= y >>> and use syntax-ppss or something like that instead of regexps. >> I wonder how that could be fixed exactly. parse-partial-sexp doesn't loo= k >> helpful, because it works with single characters, and sgml is concerned = with >> full tags. It also has to handle unclosed tags like
, some closing t= ags >> are optional, and HTML 4 has self-closing tags. > > I think just checking after the regexp-match whether the match was found > within a "comment" should do the trick, assuming we can get syntax-ppss > (or some extension thereof) to treat "other modes" as comments. So this is similar to a light version of my suggestion. Just change one function instead of all functions that are reading the buffer. I am beginning to like the idea ;-) "syntax-ppss" then need a table of chunks. And there must be a way to quickly switch that table. Could it look like a macro, something like "with-chunks"? Will that take care of "inner calls" to syntax-ppss in a correct way?