From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags Date: Wed, 20 Mar 2013 07:36:59 +0400 Message-ID: <87k3p2rbc4.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1363750712 27216 80.91.229.3 (20 Mar 2013 03:38:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Mar 2013 03:38:32 +0000 (UTC) To: 14003@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 20 04:38:58 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1UI9re-0004sV-Ah for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Mar 2013 04:38:58 +0100 Original-Received: from localhost ([::1]:44911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI9rH-0007xu-3m for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Mar 2013 23:38:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI9r8-0007m9-EY for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:38:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI9r2-0006c2-7N for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:38:26 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI9r2-0006bw-3g for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:38:20 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UI9sg-0001dA-FF for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Mar 2013 03:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14003 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13637507506196 (code B ref -1); Wed, 20 Mar 2013 03:40:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Mar 2013 03:39:10 +0000 Original-Received: from localhost ([127.0.0.1]:36505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UI9rq-0001bt-1D for submit@debbugs.gnu.org; Tue, 19 Mar 2013 23:39:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56131) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UI9ro-0001bl-Cy for submit@debbugs.gnu.org; Tue, 19 Mar 2013 23:39:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI9q1-0006UJ-PQ for submit@debbugs.gnu.org; Tue, 19 Mar 2013 23:37:25 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:54487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI9q1-0006UF-MY for submit@debbugs.gnu.org; Tue, 19 Mar 2013 23:37:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI9pt-0007So-Tz for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:37:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UI9pl-0006S9-Q7 for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:37:09 -0400 Original-Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:50013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UI9pl-0006Rt-Iw for bug-gnu-emacs@gnu.org; Tue, 19 Mar 2013 23:37:01 -0400 Original-Received: by mail-la0-f45.google.com with SMTP id er20so2317254lab.32 for ; Tue, 19 Mar 2013 20:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:mime-version :content-type:x-antivirus:x-antivirus-status; bh=7aj5vRFajVjfDpR8onCYakAYCMGO+0AeJCc0s57d+6g=; b=D2A37naexFK16mjVhqwE7/4Ca8RHfQajgRtQKM/NlZstP8C8tiVO12x5gEJTDH0rNj eeFACXAceqRgzD6QrsPigmSUyiPDRFx0sEWrumjSl1xwtKTKZgWrDPTrazdbcF/v+ipY EnoJRiS5ft9wnR/avLddwJ49anEtvF28LbD8GSer9hh5FPuj7+lHl3WqW6qzK30fe7RG TBbYiiT3hlbcS5xQh1QXcuiuVNNlx9NhVNdu4q1URbu5cz1+OoAeepKvujAkKimfEbae G8hBgD9c7e1j51DsBlGB36ybjB8CuheB7BBB17cMp/1xoVULMHeBcEtM10iiOUzUcvbb tKhQ== X-Received: by 10.152.109.208 with SMTP id hu16mr4086693lab.45.1363750620157; Tue, 19 Mar 2013 20:37:00 -0700 (PDT) Original-Received: from vbx ([178.252.98.87]) by mx.google.com with ESMTPS id fz10sm23858lbb.12.2013.03.19.20.36.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Mar 2013 20:36:58 -0700 (PDT) X-Antivirus: avast! (VPS 130319-1, 20.03.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72730 Archived-At: sgml-mode has some support for preprocessing tags. When it sees tags with percent characters inside (<% hello! %>), it says that the tag's type is `jsp'. The templating engine may be different (e.g. ERB or EJS), but all of these examples can have arbitrary code inside, including angle brackets, usually serving as comparison operators. Before revno:111900, only having "<" inside a `jsp' tag was a problem: it broke indentation on the following lines, until a closing containing tag. With the aforementioned revision, having either "<" or ">" inside a `jsp' tag breaks string highlighting, because they changes the depth in parens returned by (syntax-ppss). So, the previously discussed general problem (http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00238.html) got worse in practice. I think we can make it better in this specific case without solving it in general, and doing it for html-mode would be a big win. Roughly, I propose to add a rule in sgml-syntax-propertize-function that would forcibly mark all angle brackets between <% and %> as punctuation syntax. Testing it with (with-silent-modifications (put-text-property (point) (1+ (point)) 'syntax-table (string-to-syntax "."))) seems to help both with highlighting and indentation. Before I started writing this text, I had another approach in mind, but this is something that I can probably do in mmm-mode instead, without changing sgml-mode, by wrapping submodes' syntax-propertize-functions. Still, doing it sgml-mode should be simpler. Thoughts?