From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Oct 2016 21:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 24767@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14771714588286 (code B ref -1); Sat, 22 Oct 2016 21:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Oct 2016 21:24:18 +0000 Received: from localhost ([127.0.0.1]:46639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by3m5-00029Z-Q3 for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by3m3-00029J-PR for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by3ly-0006AQ-19 for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1by3lx-0006AK-Tx for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by3lw-0003Wm-TV for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:24:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by3lt-00068J-PB for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:24:08 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:57819) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1by3lt-00067p-LJ for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:24:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DGBAALW9BX/1DcbkFdHAESAQUBgxsBAQEBAR6BDINBpA4BkTeCAxSGAgSBbTkUAQIBAQEBAQEBXieFPl8TIQEcDRiIaaBPnDeQCYUQBZlZkRWHeIYLkEseNoIZAQuCRyCGCgEBAQ X-IPAS-Result: A0DGBAALW9BX/1DcbkFdHAESAQUBgxsBAQEBAR6BDINBpA4BkTeCAxSGAgSBbTkUAQIBAQEBAQEBXieFPl8TIQEcDRiIaaBPnDeQCYUQBZlZkRWHeIYLkEseNoIZAQuCRyCGCgEBAQ X-IronPort-AV: E=Sophos;i="5.30,296,1470715200"; d="scan'208";a="276790117" Received: from 65-110-220-80.cpe.pppoe.ca (HELO pastel.home) ([65.110.220.80]) by smtp.teksavvy.com with ESMTP; 22 Oct 2016 17:24:01 -0400 Received: by pastel.home (Postfix, from userid 20848) id BA3DD615BE; Sat, 22 Oct 2016 17:24:01 -0400 (EDT) From: Stefan Monnier Date: Sat, 22 Oct 2016 17:24:01 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Package: Emacs Try the following: % emacs -Q -l .../elpa/packages/jgraph-mode/jgraph-mode.el ~/foo.jgr (* hello *) The string "(* hello *)" should be highlighted as a comment, and is indeed correctly highlighted this way in Emacs-25 (and Emacs-24), but not in "master". The particularity of jgraph-mode's handling of (*...*) is that ?(, ?), and ?* are given "symbol" syntax, so I guess that src/syntax.c was modified in a way which makes it skip the whole (* as being a symbol. Stefan From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Oct 2016 06:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier , Alan Mackenzie Cc: 24767@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 24767-submit@debbugs.gnu.org id=B24767.14772034541342 (code B ref 24767); Sun, 23 Oct 2016 06:18:02 +0000 Received: (at 24767) by debbugs.gnu.org; 23 Oct 2016 06:17:34 +0000 Received: from localhost ([127.0.0.1]:47023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byC6A-0000LZ-65 for submit@debbugs.gnu.org; Sun, 23 Oct 2016 02:17:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byC68-0000LN-Ps for 24767@debbugs.gnu.org; Sun, 23 Oct 2016 02:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byC60-0008An-CO for 24767@debbugs.gnu.org; Sun, 23 Oct 2016 02:17:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byC60-0008Aj-9B; Sun, 23 Oct 2016 02:17:24 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2415 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1byC5z-00063Q-A7; Sun, 23 Oct 2016 02:17:23 -0400 Date: Sun, 23 Oct 2016 09:17:19 +0300 Message-Id: <83bmybpp1s.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Stefan Monnier on Sat, 22 Oct 2016 17:24:01 -0400) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) > From: Stefan Monnier > Date: Sat, 22 Oct 2016 17:24:01 -0400 > > % emacs -Q -l .../elpa/packages/jgraph-mode/jgraph-mode.el ~/foo.jgr > (* hello *) > > The string "(* hello *)" should be highlighted as a comment, and is > indeed correctly highlighted this way in Emacs-25 (and Emacs-24), but > not in "master". > > The particularity of jgraph-mode's handling of (*...*) is that ?(, ?), > and ?* are given "symbol" syntax, so I guess that src/syntax.c was > modified in a way which makes it skip the whole (* as being a symbol. I suspect 9dcf599. Alan, could you please take a look? Stefan, I think it would be good to have a test for this in the test suite, even if for now it will fail. Thanks. From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Oct 2016 15:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Stefan Monnier , 24767@debbugs.gnu.org Received: via spool by 24767-submit@debbugs.gnu.org id=B24767.14772368782970 (code B ref 24767); Sun, 23 Oct 2016 15:35:02 +0000 Received: (at 24767) by debbugs.gnu.org; 23 Oct 2016 15:34:38 +0000 Received: from localhost ([127.0.0.1]:49114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byKnG-0000lq-0W for submit@debbugs.gnu.org; Sun, 23 Oct 2016 11:34:38 -0400 Received: from mail.muc.de ([193.149.48.3]:43860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byKnE-0000lh-EU for 24767@debbugs.gnu.org; Sun, 23 Oct 2016 11:34:36 -0400 Received: (qmail 66148 invoked by uid 3782); 23 Oct 2016 15:34:34 -0000 Received: from acm.muc.de (p548C6AED.dip0.t-ipconnect.de [84.140.106.237]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 23 Oct 2016 17:34:32 +0200 Received: (qmail 23710 invoked by uid 1000); 23 Oct 2016 15:34:09 -0000 Date: Sun, 23 Oct 2016 15:34:09 +0000 Message-ID: <20161023153409.GA23704@acm.fritz.box> References: <83bmybpp1s.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83bmybpp1s.fsf@gnu.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hello, Eli. On Sun, Oct 23, 2016 at 09:17:19AM +0300, Eli Zaretskii wrote: > > From: Stefan Monnier > > Date: Sat, 22 Oct 2016 17:24:01 -0400 > > > > % emacs -Q -l .../elpa/packages/jgraph-mode/jgraph-mode.el ~/foo.jgr > > (* hello *) > > > > The string "(* hello *)" should be highlighted as a comment, and is > > indeed correctly highlighted this way in Emacs-25 (and Emacs-24), but > > not in "master". > > > > The particularity of jgraph-mode's handling of (*...*) is that ?(, ?), > > and ?* are given "symbol" syntax, so I guess that src/syntax.c was > > modified in a way which makes it skip the whole (* as being a symbol. > I suspect 9dcf599. Alan, could you please take a look? Yes, 9dcf599 is indeed where the bug was introduced. I'll be looking at it. > Stefan, I think it would be good to have a test for this in the test > suite, even if for now it will fail. > Thanks. -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2016 19:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 24767@debbugs.gnu.org Received: via spool by 24767-submit@debbugs.gnu.org id=B24767.147733771928301 (code B ref 24767); Mon, 24 Oct 2016 19:36:01 +0000 Received: (at 24767) by debbugs.gnu.org; 24 Oct 2016 19:35:19 +0000 Received: from localhost ([127.0.0.1]:54838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byl1i-0007MN-Oy for submit@debbugs.gnu.org; Mon, 24 Oct 2016 15:35:18 -0400 Received: from mail.muc.de ([193.149.48.3]:17307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byl1g-0007ME-Us for 24767@debbugs.gnu.org; Mon, 24 Oct 2016 15:35:17 -0400 Received: (qmail 84870 invoked by uid 3782); 24 Oct 2016 19:35:15 -0000 Received: from acm.muc.de (p548C73C8.dip0.t-ipconnect.de [84.140.115.200]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 24 Oct 2016 21:35:13 +0200 Received: (qmail 4646 invoked by uid 1000); 24 Oct 2016 19:34:51 -0000 Date: Mon, 24 Oct 2016 19:34:51 +0000 Message-ID: <20161024193451.GA4544@acm.fritz.box> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Hello, Stefan. On Sat, Oct 22, 2016 at 05:24:01PM -0400, Stefan Monnier wrote: > Package: Emacs > Try the following: > % emacs -Q -l .../elpa/packages/jgraph-mode/jgraph-mode.el ~/foo.jgr > (* hello *) > The string "(* hello *)" should be highlighted as a comment, and is > indeed correctly highlighted this way in Emacs-25 (and Emacs-24), but > not in "master". > The particularity of jgraph-mode's handling of (*...*) is that ?(, ?), > and ?* are given "symbol" syntax, so I guess that src/syntax.c was > modified in a way which makes it skip the whole (* as being a symbol. Suppose the jgraph buffer contains: he(*llo*) . Is this supposed to analyse as the symbol "he" followed by a comment, or should it be the symbol "he(*llo*)"? Currently, even Emacs-25 doesn't recognise the "(*llo*)" as a comment. It seems to me more likely that the comment should be recognised, but I don't know jgraph. To blame for this is the section of code in scan_sexps_forward (in Emacs-25) just after the label symstarted: where there is a subsidiary loop on "(from < end)" which doesn't do any checking on the comment flags. Maybe the solution (in master) would be to add the checking of the comment flags into this subsidiary loop. > Stefan -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Oct 2016 13:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 24767@debbugs.gnu.org Received: via spool by 24767-submit@debbugs.gnu.org id=B24767.147740355811177 (code B ref 24767); Tue, 25 Oct 2016 13:53:01 +0000 Received: (at 24767) by debbugs.gnu.org; 25 Oct 2016 13:52:38 +0000 Received: from localhost ([127.0.0.1]:55831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bz29d-0002uC-OK for submit@debbugs.gnu.org; Tue, 25 Oct 2016 09:52:38 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:61668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bz29b-0002tw-Pg for 24767@debbugs.gnu.org; Tue, 25 Oct 2016 09:52:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AFBQALW9BX/1qOs2tdGgEBAQECAQEBAYMtAQEBAQEehE2FULF5hhYEAgKBaTwRAQIBAQEBAQEBXieEYgEBAwFWIwULCw4mEhQYDSQuiCcIvFUBAQEBBgIlin2KHAEEmVmZDYYLkEs0IIRsIIYKAQEB X-IPAS-Result: A0AFBQALW9BX/1qOs2tdGgEBAQECAQEBAYMtAQEBAQEehE2FULF5hhYEAgKBaTwRAQIBAQEBAQEBXieEYgEBAwFWIwULCw4mEhQYDSQuiCcIvFUBAQEBBgIlin2KHAEEmVmZDYYLkEs0IIRsIIYKAQEB X-IronPort-AV: E=Sophos;i="5.30,296,1470715200"; d="scan'208";a="277046385" Received: from 107-179-142-90.cpe.teksavvy.com (HELO ceviche.home) ([107.179.142.90]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Oct 2016 09:52:29 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 914FC6622D; Tue, 25 Oct 2016 09:52:28 -0400 (EDT) From: Stefan Monnier Message-ID: References: <20161024193451.GA4544@acm.fritz.box> Date: Tue, 25 Oct 2016 09:52:28 -0400 In-Reply-To: <20161024193451.GA4544@acm.fritz.box> (Alan Mackenzie's message of "Mon, 24 Oct 2016 19:34:51 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Suppose the jgraph buffer contains: > > he(*llo*) > > . Is this supposed to analyse as the symbol "he" followed by a comment, > or should it be the symbol "he(*llo*)"? Good question. To the extent that src/syntax.c shouldn't be specific to jgraph-mode, the answer shouldn't depend on the choice made by Jgraph's author. > Currently, even Emacs-25 doesn't recognise the "(*llo*)" as a comment. I think it's good enough to preserve backward compatibility, then. > It seems to me more likely that the comment should be recognised, but > I don't know jgraph. To choose which of the two behavior is desired, the major mode author can use syntax-propertize to catch this rare corner case anyway. > Maybe the solution (in master) would be to add the checking of the > comment flags into this subsidiary loop. Let's not worry about it. Stefan From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2016 11:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 24767@debbugs.gnu.org Received: via spool by 24767-submit@debbugs.gnu.org id=B24767.14777389753064 (code B ref 24767); Sat, 29 Oct 2016 11:03:01 +0000 Received: (at 24767) by debbugs.gnu.org; 29 Oct 2016 11:02:55 +0000 Received: from localhost ([127.0.0.1]:35854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0RPa-0000nK-TQ for submit@debbugs.gnu.org; Sat, 29 Oct 2016 07:02:55 -0400 Received: from mail.muc.de ([193.149.48.3]:52026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0RPZ-0000mt-KW for 24767@debbugs.gnu.org; Sat, 29 Oct 2016 07:02:54 -0400 Received: (qmail 40749 invoked by uid 3782); 29 Oct 2016 11:02:52 -0000 Received: from acm.muc.de (p4FC46D25.dip0.t-ipconnect.de [79.196.109.37]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 29 Oct 2016 13:02:51 +0200 Received: (qmail 5767 invoked by uid 1000); 29 Oct 2016 11:02:29 -0000 Date: Sat, 29 Oct 2016 11:02:29 +0000 Message-ID: <20161029110228.GA5696@acm.fritz.box> References: <20161024193451.GA4544@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) Hello, Stefan. On Tue, Oct 25, 2016 at 09:52:28AM -0400, Stefan Monnier wrote: > > Suppose the jgraph buffer contains: > > > > he(*llo*) > > > > . Is this supposed to analyse as the symbol "he" followed by a comment, > > or should it be the symbol "he(*llo*)"? > Good question. To the extent that src/syntax.c shouldn't be specific to > jgraph-mode, the answer shouldn't depend on the choice made by > Jgraph's author. > > Currently, even Emacs-25 doesn't recognise the "(*llo*)" as a comment. > I think it's good enough to preserve backward compatibility, then. > > It seems to me more likely that the comment should be recognised, but > > I don't know jgraph. > To choose which of the two behavior is desired, the major mode author > can use syntax-propertize to catch this rare corner case anyway. > > Maybe the solution (in master) would be to add the checking of the > > comment flags into this subsidiary loop. > Let's not worry about it. In the end, that's what I've done. The fix was less tricky than I thought it would be. It recognises the comment in he(*llo*). Would you try out the following patch, please, and let me know whether there are still problems with it. Thanks. diff --git a/src/syntax.c b/src/syntax.c index 667de40..d463f7e 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3124,6 +3124,7 @@ scan_sexps_forward (struct lisp_parse_state *state, ptrdiff_t prev_from; /* Keep one character before FROM. */ ptrdiff_t prev_from_byte; int prev_from_syntax, prev_prev_from_syntax; + int syntax; bool boundary_stop = commentstop == -1; bool nofence; bool found; @@ -3191,8 +3192,6 @@ do { prev_from = from; \ while (from < end) { - int syntax; - if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax) && (c1 = FETCH_CHAR (from_byte), syntax = SYNTAX_WITH_FLAGS (c1), @@ -3258,7 +3257,24 @@ do { prev_from = from; \ while (from < end) { int symchar = FETCH_CHAR_AS_MULTIBYTE (from_byte); - switch (SYNTAX (symchar)) + + if (SYNTAX_FLAGS_COMSTART_FIRST (prev_from_syntax) + && (syntax = SYNTAX_WITH_FLAGS (symchar), + SYNTAX_FLAGS_COMSTART_SECOND (syntax))) + { + state->comstyle + = SYNTAX_FLAGS_COMMENT_STYLE (syntax, prev_from_syntax); + comnested = (SYNTAX_FLAGS_COMMENT_NESTED (prev_from_syntax) + | SYNTAX_FLAGS_COMMENT_NESTED (syntax)); + state->incomment = comnested ? 1 : -1; + state->comstr_start = prev_from; + INC_FROM; + prev_from_syntax = Smax; + code = Scomment; + goto atcomment; + } + + switch (SYNTAX (symchar)) { case Scharquote: case Sescape: @@ -3280,6 +3296,7 @@ do { prev_from = from; \ case Scomment_fence: /* Can't happen because it's handled above. */ case Scomment: + atcomment: if (commentstop || boundary_stop) goto done; startincomment: /* The (from == BEGV) test was to enter the loop in the middle so > Stefan -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Jun 20 07:17:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24767: jgraph comments not recognized any more Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Oct 2016 16:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 24767@debbugs.gnu.org Received: via spool by 24767-submit@debbugs.gnu.org id=B24767.14778434806344 (code B ref 24767); Sun, 30 Oct 2016 16:05:01 +0000 Received: (at 24767) by debbugs.gnu.org; 30 Oct 2016 16:04:40 +0000 Received: from localhost ([127.0.0.1]:37313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0sbA-0001eG-Bj for submit@debbugs.gnu.org; Sun, 30 Oct 2016 12:04:40 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:47758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0sb7-0001e2-Uc for 24767@debbugs.gnu.org; Sun, 30 Oct 2016 12:04:38 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DyAQALW9BX/+953mhdGgEBAQECAQEBAUOCagEBAQEBHoRNhVCEZasRggOGFgQCAoFpORQBAgEBAQEBAQFeJ4RiAQEDAVYjBQsLDiYSFBgNJIhVCLxVAQEBAQYCJYp9ihwBBJlZkRUBFYRegwSGC5BLHjaEbCCGCgEBAQ X-IPAS-Result: A0DyAQALW9BX/+953mhdGgEBAQECAQEBAUOCagEBAQEBHoRNhVCEZasRggOGFgQCAoFpORQBAgEBAQEBAQFeJ4RiAQEDAVYjBQsLDiYSFBgNJIhVCLxVAQEBAQYCJYp9ihwBBJlZkRUBFYRegwSGC5BLHjaEbCCGCgEBAQ X-IronPort-AV: E=Sophos;i="5.30,296,1470715200"; d="scan'208";a="277621168" Received: from 104-222-121-239.cpe.teksavvy.com (HELO pastel.home) ([104.222.121.239]) by smtp.teksavvy.com with ESMTP; 30 Oct 2016 12:03:31 -0400 Received: by pastel.home (Postfix, from userid 20848) id D30C364EE4; Sat, 29 Oct 2016 11:12:51 -0400 (EDT) From: Stefan Monnier Message-ID: References: <20161024193451.GA4544@acm.fritz.box> <20161029110228.GA5696@acm.fritz.box> Date: Sat, 29 Oct 2016 11:12:51 -0400 In-Reply-To: <20161029110228.GA5696@acm.fritz.box> (Alan Mackenzie's message of "Sat, 29 Oct 2016 11:02:29 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.8 (/) > Would you try out the following patch, please, and let me know whether > there are still problems with it. Thanks. I confirm it fixes my problems, thank you, Stefan From unknown Fri Jun 20 07:17:24 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Monnier Subject: bug#24767: closed (Re: bug#24767: jgraph comments not recognized any more) Message-ID: References: <20161030173730.GA17103@acm.fritz.box> X-Gnu-PR-Message: they-closed 24767 X-Gnu-PR-Package: emacs Reply-To: 24767@debbugs.gnu.org Date: Sun, 30 Oct 2016 17:38:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1477849082-15382-1" This is a multi-part message in MIME format... ------------=_1477849082-15382-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #24767: jgraph comments not recognized any more which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 24767@debbugs.gnu.org. --=20 24767: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24767 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1477849082-15382-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 24767-done) by debbugs.gnu.org; 30 Oct 2016 17:37:54 +0000 Received: from localhost ([127.0.0.1]:37382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0u3O-0003zm-Lu for submit@debbugs.gnu.org; Sun, 30 Oct 2016 13:37:54 -0400 Received: from mail.muc.de ([193.149.48.3]:31781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0u3N-0003ze-N7 for 24767-done@debbugs.gnu.org; Sun, 30 Oct 2016 13:37:54 -0400 Received: (qmail 71557 invoked by uid 3782); 30 Oct 2016 17:37:52 -0000 Received: from acm.muc.de (p548C7C6A.dip0.t-ipconnect.de [84.140.124.106]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 30 Oct 2016 18:37:51 +0100 Received: (qmail 17202 invoked by uid 1000); 30 Oct 2016 17:37:30 -0000 Date: Sun, 30 Oct 2016 17:37:30 +0000 To: Stefan Monnier Subject: Re: bug#24767: jgraph comments not recognized any more Message-ID: <20161030173730.GA17103@acm.fritz.box> References: <20161024193451.GA4544@acm.fritz.box> <20161029110228.GA5696@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.5 (-) X-Debbugs-Envelope-To: 24767-done Cc: 24767-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) Hello, Stefan. On Sat, Oct 29, 2016 at 11:12:51AM -0400, Stefan Monnier wrote: > > Would you try out the following patch, please, and let me know whether > > there are still problems with it. Thanks. > I confirm it fixes my problems, thank you, I've committed it, and am closing the bug. > Stefan -- Alan Mackenzie (Nuremberg, Germany). ------------=_1477849082-15382-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Oct 2016 21:24:18 +0000 Received: from localhost ([127.0.0.1]:46639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by3m5-00029Z-Q3 for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1by3m3-00029J-PR for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by3ly-0006AQ-19 for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:54553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1by3lx-0006AK-Tx for submit@debbugs.gnu.org; Sat, 22 Oct 2016 17:24:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by3lw-0003Wm-TV for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:24:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by3lt-00068J-PB for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:24:08 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:57819) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1by3lt-00067p-LJ for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2016 17:24:05 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DGBAALW9BX/1DcbkFdHAESAQUBgxsBAQEBAR6BDINBpA4BkTeCAxSGAgSBbTkUAQIBAQEBAQEBXieFPl8TIQEcDRiIaaBPnDeQCYUQBZlZkRWHeIYLkEseNoIZAQuCRyCGCgEBAQ X-IPAS-Result: A0DGBAALW9BX/1DcbkFdHAESAQUBgxsBAQEBAR6BDINBpA4BkTeCAxSGAgSBbTkUAQIBAQEBAQEBXieFPl8TIQEcDRiIaaBPnDeQCYUQBZlZkRWHeIYLkEseNoIZAQuCRyCGCgEBAQ X-IronPort-AV: E=Sophos;i="5.30,296,1470715200"; d="scan'208";a="276790117" Received: from 65-110-220-80.cpe.pppoe.ca (HELO pastel.home) ([65.110.220.80]) by smtp.teksavvy.com with ESMTP; 22 Oct 2016 17:24:01 -0400 Received: by pastel.home (Postfix, from userid 20848) id BA3DD615BE; Sat, 22 Oct 2016 17:24:01 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: jgraph comments not recognized any more Date: Sat, 22 Oct 2016 17:24:01 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Package: Emacs Try the following: % emacs -Q -l .../elpa/packages/jgraph-mode/jgraph-mode.el ~/foo.jgr (* hello *) The string "(* hello *)" should be highlighted as a comment, and is indeed correctly highlighted this way in Emacs-25 (and Emacs-24), but not in "master". The particularity of jgraph-mode's handling of (*...*) is that ?(, ?), and ?* are given "symbol" syntax, so I guess that src/syntax.c was modified in a way which makes it skip the whole (* as being a symbol. Stefan ------------=_1477849082-15382-1--