From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 23:39:10 2013 Received: (at submit) by debbugs.gnu.org; 20 Mar 2013 03:39:10 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 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 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 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 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 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) 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) From: Dmitry Gutov To: bug-gnu-emacs@gnu.org Subject: 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> MIME-Version: 1.0 Content-Type: text/plain 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-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) 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? From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 26 12:51:41 2013 Received: (at 14003) by debbugs.gnu.org; 26 Mar 2013 16:51:41 +0000 Received: from localhost ([127.0.0.1]:46314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UKX65-0007qq-Ks for submit@debbugs.gnu.org; Tue, 26 Mar 2013 12:51:41 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:42079) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UKX63-0007qh-FO for 14003@debbugs.gnu.org; Tue, 26 Mar 2013 12:51:40 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r2QGnIAp018062; Tue, 26 Mar 2013 12:49:18 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 1319DB40E2; Tue, 26 Mar 2013 12:49:18 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags Message-ID: References: <87k3p2rbc4.fsf@yandex.ru> Date: Tue, 26 Mar 2013 12:49:18 -0400 In-Reply-To: <87k3p2rbc4.fsf@yandex.ru> (Dmitry Gutov's message of "Wed, 20 Mar 2013 07:36:59 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.2 X-NAI-Spam-Rules: 2 Rules triggered GEN_SPAM_FEATRE=0.2, RV4529=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4529> : streams <928528> : uri <1376966> X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: 14003 Cc: 14003@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) > 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 Sounds good. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 01 09:35:03 2013 Received: (at 14003) by debbugs.gnu.org; 1 Apr 2013 13:35:03 +0000 Received: from localhost ([127.0.0.1]:55718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMet4-0003xe-83 for submit@debbugs.gnu.org; Mon, 01 Apr 2013 09:35:03 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57898) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMesz-0003xN-Qd for 14003@debbugs.gnu.org; Mon, 01 Apr 2013 09:34:59 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r31DW3oV014143; Mon, 1 Apr 2013 09:32:03 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 231C4AE334; Mon, 1 Apr 2013 09:32:03 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags Message-ID: References: <87k3p2rbc4.fsf@yandex.ru> Date: Mon, 01 Apr 2013 09:32:03 -0400 In-Reply-To: <87k3p2rbc4.fsf@yandex.ru> (Dmitry Gutov's message of "Wed, 20 Mar 2013 07:36:59 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4536=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4536> : streams <931967> : uri <1381810> X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 14003 Cc: 14003@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) > 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? I agree doing it in sgml-mode would be simpler. I do think that multi-major-mode support should let us handle comments/strings in a separate mode (text-mode, by default). But I'm not sure if current multi-major-mode packages are up to that task. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 01 16:46:25 2013 Received: (at 14003-done) by debbugs.gnu.org; 1 Apr 2013 20:46:25 +0000 Received: from localhost ([127.0.0.1]:56520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMlcW-0007rE-EV for submit@debbugs.gnu.org; Mon, 01 Apr 2013 16:46:25 -0400 Received: from mail-la0-f41.google.com ([209.85.215.41]:40635) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UMlcT-0007r3-7H for 14003-done@debbugs.gnu.org; Mon, 01 Apr 2013 16:46:22 -0400 Received: by mail-la0-f41.google.com with SMTP id fo12so2482527lab.14 for <14003-done@debbugs.gnu.org>; Mon, 01 Apr 2013 13:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=c/KQV6IXgQWQCeRkuhAGip7bhYAXjHlH1EOGwscy2ZM=; b=ZVDdUhhUvS62StlBOB9C9pVNFF5VvSg6kkYtzkOv8KD+3o/+Qy097qFUONHopVAGSE XCXItdAmwpwWM58se7xmeH8eXl4E+Ih8y1O0zdvQu3yUmxS+/JgJ1VVqmyq8QfPh7kCU 1WUa5uIS/mPyWOKGr753ueZ/+67Yxw+mfdQPgElRdeFwyk5F0weczxGMZAUyCjB5UPHJ RMzHDMIQnHopNHuXzzn3tz5k3ibmu+wwo0XHA7OFX8iY5nkb3V1iorh7cqX7f7e+icuP vTqqPvv6JUZ9KiwTIxWTI2034+bfk3MZdyWy3OwV6coPcRv+zWKsXN8u3qZSbhr7a7Ty Vh5g== X-Received: by 10.152.105.109 with SMTP id gl13mr6322813lab.40.1364849005798; Mon, 01 Apr 2013 13:43:25 -0700 (PDT) Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id fl9sm6009865lbb.9.2013.04.01.13.43.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Apr 2013 13:43:24 -0700 (PDT) Message-ID: <5159F170.9020903@yandex.ru> Date: Tue, 02 Apr 2013 00:43:28 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags References: <87k3p2rbc4.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 130401-0, 01.04.2013), Outbound message X-Antivirus-Status: Clean X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 14003-done Cc: 14003-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 01.04.2013 17:32, Stefan Monnier wrote: >> 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? > > I agree doing it in sgml-mode would be simpler. I've thought about it some more, and looks like it would be incompatible with what mmm-mode is currently doing. One of the latest additions is the composite syntax-propertize-function: https://github.com/purcell/mmm-mode/blob/master/mmm-region.el#L806 It iterates over the regions and calls syntax-propertize-function of each major mode, passing it the bounds of the region. So adding propertization of angle brackets to sgml-syntax-propertize-function won't help because it won't be called on submode regions. Wrapping propertize-functions of the submodes with that logic should work fine, though. So I guess I'll just close this bug. > I do think that multi-major-mode support should let us handle > comments/strings in a separate mode (text-mode, by default). But I'm > not sure if current multi-major-mode packages are up to that task. Eh, maybe? With some caveats, probably, but delineating subregions based on string/comment status should be doable with a custom matcher function. But it doesn't seem to solve any big problems, AFAICT. Handling code regions nested inside interpolated regions in strings, which I've posted about in emacs-devel before, would be nice to have, but it's much less of an immediate problem, especially since nobody uses this syntax feature of Ruby in real code much. Handling it via mmm-mode, at least, is also problematic, because the syntactic state carries between subregions. So the text inside a string subregion will still be highlighted as string: https://github.com/purcell/mmm-mode/issues/25 From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 03 14:28:57 2013 Received: (at 14003-done) by debbugs.gnu.org; 3 Apr 2013 18:28:57 +0000 Received: from localhost ([127.0.0.1]:60441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UNSQb-0000Ty-0b for submit@debbugs.gnu.org; Wed, 03 Apr 2013 14:28:57 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:32220) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UNSQY-0000Tr-JK for 14003-done@debbugs.gnu.org; Wed, 03 Apr 2013 14:28:55 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxLSu/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAsOJhIUGA0kiB4GDMEdBJEKA6R6gV6DEw X-IPAS-Result: Av4EABK/CFFFxLSu/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAsOJhIUGA0kiB4GDMEdBJEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="6402642" Received: from 69-196-180-174.dsl.teksavvy.com (HELO pastel.home) ([69.196.180.174]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Apr 2013 14:25:46 -0400 Received: by pastel.home (Postfix, from userid 20848) id 8A91967A1E; Wed, 3 Apr 2013 14:25:48 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#14003: 24.3.50; sgml-mode: support angle brackets inside jsp tags Message-ID: References: <87k3p2rbc4.fsf@yandex.ru> <5159F170.9020903@yandex.ru> Date: Wed, 03 Apr 2013 14:25:48 -0400 In-Reply-To: <5159F170.9020903@yandex.ru> (Dmitry Gutov's message of "Tue, 02 Apr 2013 00:43:28 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 14003-done Cc: 14003-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> I agree doing it in sgml-mode would be simpler. > I've thought about it some more, and looks like it would be incompatible > with what mmm-mode is currently doing. One of the latest additions is the > composite syntax-propertize-function: > https://github.com/purcell/mmm-mode/blob/master/mmm-region.el#L806 > It iterates over the regions and calls syntax-propertize-function of each > major mode, passing it the bounds of the region. So adding propertization of > angle brackets to sgml-syntax-propertize-function won't help because it > won't be called on submode regions. If don't use mmm-mode, then it should work. But indeed when you use mmm-mode to handle the <%...%> text, then it should be mmm-mode's task to handle that problem. Stefan "not saying that it's easy for mmm-mode to handle the problem" From unknown Sun Jun 22 11:36:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 02 May 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator