GNU logs - #43558, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 22 Sep 2020 09:36:02 +0000
Resent-Message-ID: <handler.43558.B.160076736116422 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 43558 <at> debbugs.gnu.org, monnier@HIDDEN
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN, Stefan Monnier <monnier@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.160076736116422
          (code B ref -1); Tue, 22 Sep 2020 09:36:02 +0000
Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 09:36:01 +0000
Received: from localhost ([127.0.0.1]:57244 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kKeiO-0004Gn-Gz
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 05:36:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:47604)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kKeiM-0004Gf-PY
 for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 05:35:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40440)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1kKeiM-0001uB-Hw
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 05:35:58 -0400
Received: from colin.muc.de ([193.149.48.1]:13791 helo=mail.muc.de)
 by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from <acm@HIDDEN>)
 id 1kKeiK-0007VT-EP
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 05:35:58 -0400
Received: (qmail 32167 invoked by uid 3782); 22 Sep 2020 09:35:51 -0000
Received: from acm.muc.de (p4fe15d08.dip0.t-ipconnect.de [79.225.93.8]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 22 Sep 2020 11:35:50 +0200
Received: (qmail 26885 invoked by uid 1000); 22 Sep 2020 09:35:50 -0000
Date: Tue, 22 Sep 2020 09:35:50 +0000
Message-ID: <20200922093550.GA26819@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@HIDDEN;
 helo=mail.muc.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:35:53
X-ACL-Warn: Detected OS   = FreeBSD 9.x or newer [fuzzy]
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hello, Emacs and Stefan.

In the following C comment:

1   /*
2     \*/
3   /**/

, with point at BOL 1, do M-: (forward-comment 1).  This leaves point
wrongly at EOL 2.  It should end up at EOL 3, since the apparent comment
ender on L2 is actually escaped.

The following patch fixes this.  Are there any objections to me
installing it?


diff --git a/src/syntax.c b/src/syntax.c
index e6af8a377b..066972e6d8 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2354,6 +2354,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
 	/* We have encountered a nested comment of the same style
 	   as the comment sequence which began this comment section.  */
 	nesting++;
+      if (comment_end_can_be_escaped
+          && (code == Sescape || code == Scharquote))
+        {
+          inc_both (&from, &from_byte);
+          UPDATE_SYNTAX_TABLE_FORWARD (from);
+          if (from == stop) continue; /* Failure */
+        }
       inc_both (&from, &from_byte);
       UPDATE_SYNTAX_TABLE_FORWARD (from);
 

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Alan Mackenzie <acm@HIDDEN>
Subject: bug#43558: Acknowledgement ([PATCH]: Fix (forward-comment 1) when
 end delimiter is escaped.)
Message-ID: <handler.43558.B.160076736116422.ack <at> debbugs.gnu.org>
References: <20200922093550.GA26819@ACM>
X-Gnu-PR-Message: ack 43558
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 43558 <at> debbugs.gnu.org
Date: Tue, 22 Sep 2020 09:36:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 43558 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
43558: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43558
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 22 Sep 2020 14:10:02 +0000
Resent-Message-ID: <handler.43558.B.160078379221923 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org
X-Debbugs-Original-Cc: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.160078379221923
          (code B ref -1); Tue, 22 Sep 2020 14:10:02 +0000
Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 14:09:52 +0000
Received: from localhost ([127.0.0.1]:60984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kKizQ-0005hV-0N
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 10:09:52 -0400
Received: from lists.gnu.org ([209.51.188.17]:33316)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kKizO-0005hO-6K
 for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 10:09:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43750)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1kKizN-0002eY-Om
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 10:09:50 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43574)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@HIDDEN>)
 id 1kKizK-0004rl-Pt
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 10:09:49 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BF3974406B2;
 Tue, 22 Sep 2020 10:09:45 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5A6BE4406AC;
 Tue, 22 Sep 2020 10:09:44 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1600783784;
 bh=2NMXrahPkvlH6JgIF46aFS7mzqiAxn8gXET7b9ZLmMA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=DEqonfae/QdoANIP5XChfP6HzQ6xNQh11FMgTyleRURt92YNtKzEZTQEjgY0WW5ll
 ZEknb0gFK+Fp+YGPyFX7pvjtm/H9YCsMAjLBJlr4psFZEJhEx/G130Gf8Rs8fhLJPt
 winR9tvi1Jl4mr42+3Gc4sJdGxCpweUYQY7XSSupMvskDv4G5DyAsAk0AhGrpSsDd1
 x81eZ7kj1jgmiu2zNRKYz2dv5tCLlSVy0Elgo7V7qFMmGjNvwG416n4+OXqo1dB/uM
 F9yWmcKTWepWObE9DxBnbGiuu1cu4Yr/YqdQk59FjnBegQIf63dixRti9hRjGIRgTU
 /pPFQzxoyY2bA==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 345B2120746;
 Tue, 22 Sep 2020 10:09:44 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvd02dzyyo.fsf-monnier+emacs@HIDDEN>
References: <20200922093550.GA26819@ACM>
Date: Tue, 22 Sep 2020 10:09:43 -0400
In-Reply-To: <20200922093550.GA26819@ACM> (Alan Mackenzie's message of "Tue,
 22 Sep 2020 09:35:50 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.056 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@HIDDEN; helo=mailscanner.iro.umontreal.ca
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 10:01:06
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic]
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi Alan,

> Hello, Emacs and Stefan.
>
> In the following C comment:
>
> 1   /*
> 2     \*/
> 3   /**/
>
> , with point at BOL 1, do M-: (forward-comment 1).  This leaves point
> wrongly at EOL 2.

That seems to be correct w.r.t the highlighting I see, OTOH.
IOW the bug seems to affect both forward-comment and parse-partial-sexp, right?

> It should end up at EOL 3, since the apparent comment
> ender on L2 is actually escaped.
>
> The following patch fixes this.

Does it fix it for `parse-partial-sexp` as well?

> Are there any objections to me installing it?

None from me, no.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 22 Sep 2020 19:42:01 +0000
Resent-Message-ID: <handler.43558.B.160080367831472 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org
X-Debbugs-Original-Cc: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.160080367831472
          (code B ref -1); Tue, 22 Sep 2020 19:42:01 +0000
Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 19:41:18 +0000
Received: from localhost ([127.0.0.1]:33455 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kKoAA-0008BX-Ge
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 15:41:18 -0400
Received: from lists.gnu.org ([209.51.188.17]:51226)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kKoA9-0008BQ-1a
 for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 15:41:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:47128)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1kKoA8-0004kK-QW
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 15:41:16 -0400
Received: from colin.muc.de ([193.149.48.1]:40298 helo=mail.muc.de)
 by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from <acm@HIDDEN>)
 id 1kKoA6-00033V-QT
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 15:41:16 -0400
Received: (qmail 77892 invoked by uid 3782); 22 Sep 2020 19:41:12 -0000
Received: from acm.muc.de (p4fe15d08.dip0.t-ipconnect.de [79.225.93.8]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 22 Sep 2020 21:41:11 +0200
Received: (qmail 1174 invoked by uid 1000); 22 Sep 2020 19:41:10 -0000
Date: Tue, 22 Sep 2020 19:41:10 +0000
Message-ID: <20200922194110.GD26819@ACM>
References: <20200922093550.GA26819@ACM>
 <jwvd02dzyyo.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwvd02dzyyo.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@HIDDEN;
 helo=mail.muc.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 15:41:12
X-ACL-Warn: Detected OS   = FreeBSD 9.x or newer [fuzzy]
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hello, Stefan.

On Tue, Sep 22, 2020 at 10:09:43 -0400, Stefan Monnier wrote:
> Hi Alan,

> > Hello, Emacs and Stefan.

> > In the following C comment:

> > 1   /*
> > 2     \*/
> > 3   /**/

> > , with point at BOL 1, do M-: (forward-comment 1).  This leaves point
> > wrongly at EOL 2.

> That seems to be correct w.r.t the highlighting I see, OTOH.
> IOW the bug seems to affect both forward-comment and parse-partial-sexp, right?

Yes.

> > It should end up at EOL 3, since the apparent comment
> > ender on L2 is actually escaped.

> > The following patch fixes this.

> Does it fix it for `parse-partial-sexp` as well?

It does, yes.  The patch is in forw_comment, which is called by
Fforward_comment, scan_lists, and scan_sexps_forward.

> > Are there any objections to me installing it?

> None from me, no.

Thanks!

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Alan Mackenzie <acm@HIDDEN>
Subject: bug#43558: closed ([PATCH]: Fix (forward-comment 1) when end
 delimiter is escaped.)
CC: tracker <at> debbugs.gnu.org
Message-ID: <handler.43558.D43558.160085147732283.ackdone <at> debbugs.gnu.org>
References: <20200923085746.GA6178@ACM> <20200922093550.GA26819@ACM>
X-Gnu-PR-Message: closed 43558
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Date: Wed, 23 Sep 2020 08:58:01 +0000
Content-Type: multipart/mixed; boundary="----------=_1600851481-32300-0"

This is a multi-part message in MIME format...

------------=_1600851481-32300-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

Your message dated Wed, 23 Sep 2020 08:57:46 +0000
with message-id <20200923085746.GA6178@ACM>
and subject line Re: bug#43558: [PATCH]: Fix (forward-comment 1) when end d=
elimiter is escaped.
has caused the debbugs.gnu.org bug report #43558,
regarding [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@HIDDEN)


--=20
43558: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43558
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1600851481-32300-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 09:36:01 +0000
Received: from localhost ([127.0.0.1]:57244 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kKeiO-0004Gn-Gz
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 05:36:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:47604)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kKeiM-0004Gf-PY
 for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 05:35:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40440)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1kKeiM-0001uB-Hw
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 05:35:58 -0400
Received: from colin.muc.de ([193.149.48.1]:13791 helo=mail.muc.de)
 by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from <acm@HIDDEN>)
 id 1kKeiK-0007VT-EP
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 05:35:58 -0400
Received: (qmail 32167 invoked by uid 3782); 22 Sep 2020 09:35:51 -0000
Received: from acm.muc.de (p4fe15d08.dip0.t-ipconnect.de [79.225.93.8]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 22 Sep 2020 11:35:50 +0200
Received: (qmail 26885 invoked by uid 1000); 22 Sep 2020 09:35:50 -0000
Date: Tue, 22 Sep 2020 09:35:50 +0000
To: bug-gnu-emacs@HIDDEN, Stefan Monnier <monnier@HIDDEN>
Subject: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Message-ID: <20200922093550.GA26819@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@HIDDEN;
 helo=mail.muc.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:35:53
X-ACL-Warn: Detected OS   = FreeBSD 9.x or newer [fuzzy]
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hello, Emacs and Stefan.

In the following C comment:

1   /*
2     \*/
3   /**/

, with point at BOL 1, do M-: (forward-comment 1).  This leaves point
wrongly at EOL 2.  It should end up at EOL 3, since the apparent comment
ender on L2 is actually escaped.

The following patch fixes this.  Are there any objections to me
installing it?


diff --git a/src/syntax.c b/src/syntax.c
index e6af8a377b..066972e6d8 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2354,6 +2354,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
 	/* We have encountered a nested comment of the same style
 	   as the comment sequence which began this comment section.  */
 	nesting++;
+      if (comment_end_can_be_escaped
+          && (code == Sescape || code == Scharquote))
+        {
+          inc_both (&from, &from_byte);
+          UPDATE_SYNTAX_TABLE_FORWARD (from);
+          if (from == stop) continue; /* Failure */
+        }
       inc_both (&from, &from_byte);
       UPDATE_SYNTAX_TABLE_FORWARD (from);
 

-- 
Alan Mackenzie (Nuremberg, Germany).



------------=_1600851481-32300-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 43558-done) by debbugs.gnu.org; 23 Sep 2020 08:57:57 +0000
Received: from localhost ([127.0.0.1]:34506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kL0b7-0008Od-HN
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 04:57:57 -0400
Received: from colin.muc.de ([193.149.48.1]:64147 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kL0b3-0008OG-W2
 for 43558-done <at> debbugs.gnu.org; Wed, 23 Sep 2020 04:57:56 -0400
Received: (qmail 35150 invoked by uid 3782); 23 Sep 2020 08:57:47 -0000
Received: from acm.muc.de (p4fe156c4.dip0.t-ipconnect.de [79.225.86.196]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 23 Sep 2020 10:57:46 +0200
Received: (qmail 6193 invoked by uid 1000); 23 Sep 2020 08:57:46 -0000
Date: Wed, 23 Sep 2020 08:57:46 +0000
To: 43558-done <at> debbugs.gnu.org
Subject: Re: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter
 is escaped.
Message-ID: <20200923085746.GA6178@ACM>
References: <20200922093550.GA26819@ACM>
 <handler.43558.B.160076736116422.ack <at> debbugs.gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <handler.43558.B.160076736116422.ack <at> debbugs.gnu.org>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43558-done
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Bug fixed in master.

-- 
Alan Mackenzie (Nuremberg, Germany).


------------=_1600851481-32300-0--


Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Alan Mackenzie <acm@HIDDEN>
Subject: bug#43558: closed (Re: bug#43558: [PATCH]: Fix (forward-comment
 1) when end delimiter is escaped.)
Message-ID: <handler.43558.D43558.160085147732283.notifdone <at> debbugs.gnu.org>
References: <20200923085746.GA6178@ACM> <20200922093550.GA26819@ACM>
X-Gnu-PR-Message: they-closed 43558
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 43558 <at> debbugs.gnu.org
Date: Wed, 23 Sep 2020 08:58:02 +0000
Content-Type: multipart/mixed; boundary="----------=_1600851482-32300-1"

This is a multi-part message in MIME format...

------------=_1600851482-32300-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your bug report

#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.

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 43558 <at> debbugs.gnu.org.

--=20
43558: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43558
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1600851482-32300-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 43558-done) by debbugs.gnu.org; 23 Sep 2020 08:57:57 +0000
Received: from localhost ([127.0.0.1]:34506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kL0b7-0008Od-HN
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 04:57:57 -0400
Received: from colin.muc.de ([193.149.48.1]:64147 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kL0b3-0008OG-W2
 for 43558-done <at> debbugs.gnu.org; Wed, 23 Sep 2020 04:57:56 -0400
Received: (qmail 35150 invoked by uid 3782); 23 Sep 2020 08:57:47 -0000
Received: from acm.muc.de (p4fe156c4.dip0.t-ipconnect.de [79.225.86.196]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 23 Sep 2020 10:57:46 +0200
Received: (qmail 6193 invoked by uid 1000); 23 Sep 2020 08:57:46 -0000
Date: Wed, 23 Sep 2020 08:57:46 +0000
To: 43558-done <at> debbugs.gnu.org
Subject: Re: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter
 is escaped.
Message-ID: <20200923085746.GA6178@ACM>
References: <20200922093550.GA26819@ACM>
 <handler.43558.B.160076736116422.ack <at> debbugs.gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <handler.43558.B.160076736116422.ack <at> debbugs.gnu.org>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 43558-done
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Bug fixed in master.

-- 
Alan Mackenzie (Nuremberg, Germany).


------------=_1600851482-32300-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 09:36:01 +0000
Received: from localhost ([127.0.0.1]:57244 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kKeiO-0004Gn-Gz
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 05:36:01 -0400
Received: from lists.gnu.org ([209.51.188.17]:47604)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kKeiM-0004Gf-PY
 for submit <at> debbugs.gnu.org; Tue, 22 Sep 2020 05:35:59 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40440)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1kKeiM-0001uB-Hw
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 05:35:58 -0400
Received: from colin.muc.de ([193.149.48.1]:13791 helo=mail.muc.de)
 by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from <acm@HIDDEN>)
 id 1kKeiK-0007VT-EP
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2020 05:35:58 -0400
Received: (qmail 32167 invoked by uid 3782); 22 Sep 2020 09:35:51 -0000
Received: from acm.muc.de (p4fe15d08.dip0.t-ipconnect.de [79.225.93.8]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 22 Sep 2020 11:35:50 +0200
Received: (qmail 26885 invoked by uid 1000); 22 Sep 2020 09:35:50 -0000
Date: Tue, 22 Sep 2020 09:35:50 +0000
To: bug-gnu-emacs@HIDDEN, Stefan Monnier <monnier@HIDDEN>
Subject: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Message-ID: <20200922093550.GA26819@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@HIDDEN;
 helo=mail.muc.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 05:35:53
X-ACL-Warn: Detected OS   = FreeBSD 9.x or newer [fuzzy]
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

Hello, Emacs and Stefan.

In the following C comment:

1   /*
2     \*/
3   /**/

, with point at BOL 1, do M-: (forward-comment 1).  This leaves point
wrongly at EOL 2.  It should end up at EOL 3, since the apparent comment
ender on L2 is actually escaped.

The following patch fixes this.  Are there any objections to me
installing it?


diff --git a/src/syntax.c b/src/syntax.c
index e6af8a377b..066972e6d8 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2354,6 +2354,13 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
 	/* We have encountered a nested comment of the same style
 	   as the comment sequence which began this comment section.  */
 	nesting++;
+      if (comment_end_can_be_escaped
+          && (code == Sescape || code == Scharquote))
+        {
+          inc_both (&from, &from_byte);
+          UPDATE_SYNTAX_TABLE_FORWARD (from);
+          if (from == stop) continue; /* Failure */
+        }
       inc_both (&from, &from_byte);
       UPDATE_SYNTAX_TABLE_FORWARD (from);
 

-- 
Alan Mackenzie (Nuremberg, Germany).



------------=_1600851482-32300-1--


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. 
References: <20200922093550.GA26819@ACM>
In-Reply-To: <20200922093550.GA26819@ACM>
Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Sep 2020 09:03:01 +0000
Resent-Message-ID: <handler.43558.B43558.1600851732502 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.1600851732502
          (code B ref 43558); Wed, 23 Sep 2020 09:03:01 +0000
Received: (at 43558) by debbugs.gnu.org; 23 Sep 2020 09:02:12 +0000
Received: from localhost ([127.0.0.1]:34513 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kL0fE-000080-2w
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 05:02:12 -0400
Received: from mail1434c50.megamailservers.eu ([91.136.14.34]:36638
 helo=mail263c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1kL0fB-00007g-JE
 for 43558 <at> debbugs.gnu.org; Wed, 23 Sep 2020 05:02:10 -0400
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1600851723;
 bh=oYZ5DRGcCGCRQJGfDcbcqVDeaUSMZZHyRZqJK4rif+8=;
 h=From:Subject:Date:Cc:To:From;
 b=Exiqiz3eQPBlVw2M9SJbYGGAQosU6S4F85DV11q5SiSORc1vmWMw68Gkf0uTUwCEL
 2jr2ryQXM9IZj0cEJ6+FUMQpJtIIUDV8isVDQXTQce7FWL8ReQm0pIwSx9kvxL+hko
 OFg/90S4M+Uiy7sLd5XkUbUrmL5R90oqxUmjwcmk=
Feedback-ID: mattiase@HIDDEN
Received: from stanniol.lan (c-304ee655.032-75-73746f71.bbcust.telenor.se
 [85.230.78.48]) (authenticated bits=0)
 by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 08N91xoZ025746; 
 Wed, 23 Sep 2020 09:02:01 +0000
From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\))
Message-Id: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
Date: Wed, 23 Sep 2020 11:01:59 +0200
X-Mailer: Apple Mail (2.3445.104.15)
X-CTCH-RefID: str=0001.0A782F28.5F6B0F0B.0025, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=e6d4tph/ c=1 sm=1 tr=0 a=63Z2wlQ1NB3xHpgKFKE71g==:117
 a=63Z2wlQ1NB3xHpgKFKE71g==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=J16QL3N0_wU3TY4Eh3EA:9 a=CjuIK1q_8ugA:10
X-Origin-Country: SE
X-Spam-Score: 1.4 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Sorry if I misunderstood,
 but since when do backslashes escape */ in C? 
 Content analysis details:   (1.4 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.4 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Sorry if I misunderstood, but since when do backslashes escape */ in C?





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Sep 2020 14:49:01 +0000
Resent-Message-ID: <handler.43558.B43558.160087251425630 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160087251425630
          (code B ref 43558); Wed, 23 Sep 2020 14:49:01 +0000
Received: (at 43558) by debbugs.gnu.org; 23 Sep 2020 14:48:34 +0000
Received: from localhost ([127.0.0.1]:37450 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kL64Q-0006fI-5n
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 10:48:34 -0400
Received: from colin.muc.de ([193.149.48.1]:23276 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kL64O-0006ew-3N
 for 43558 <at> debbugs.gnu.org; Wed, 23 Sep 2020 10:48:32 -0400
Received: (qmail 27684 invoked by uid 3782); 23 Sep 2020 14:48:24 -0000
Received: from acm.muc.de (p4fe156c4.dip0.t-ipconnect.de [79.225.86.196]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 23 Sep 2020 16:48:24 +0200
Received: (qmail 21448 invoked by uid 1000); 23 Sep 2020 14:48:24 -0000
Date: Wed, 23 Sep 2020 14:48:24 +0000
Message-ID: <20200923144824.GD6178@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Mattias.

On Wed, Sep 23, 2020 at 11:01:59 +0200, Mattias Engdegård wrote:
> Sorry if I misunderstood, but since when do backslashes escape */ in C?

Since forever, but only in the CC Mode test suite.  :-(

I just tried it out with gcc, and it seems that \*/ does indeed end a
block comment.  But an escaped newline doesn't end a line comment,
instead continuing it to the next line.  So I got confused.  Thanks for
pointing out the mistake.

It seems that as well as the existing variable
comment-end-can-be-escaped, we need a new one, say
line-comment-end-can-be-escaped, too.  In C and C++ modes, these would
be nil and t respectively.

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Sep 2020 18:46:01 +0000
Resent-Message-ID: <handler.43558.B43558.160088670424983 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160088670424983
          (code B ref 43558); Wed, 23 Sep 2020 18:46:01 +0000
Received: (at 43558) by debbugs.gnu.org; 23 Sep 2020 18:45:04 +0000
Received: from localhost ([127.0.0.1]:37841 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kL9lI-0006Ur-3R
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 14:45:04 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kL9lG-0006U3-VF
 for 43558 <at> debbugs.gnu.org; Wed, 23 Sep 2020 14:45:03 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4A33A440703;
 Wed, 23 Sep 2020 14:44:57 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CE53044064F;
 Wed, 23 Sep 2020 14:44:55 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1600886695;
 bh=DuysRVMXl329iMy/ZAsjZjxyvpKdn7Dr5mMpO6KcrsA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=edxlcPOXxDkHS/oGfhsIAeZbpvCv2Pip88WPV2TCfgdusslBQao5Vo9d8fiQp0iwg
 JRQKODcMlYoqAjID+1LerD0VlFefQS/FETwjiDqpLSAulMzFd1khf8opiXkMdFsk13
 TCFazxsWAcdc5j1qzy/ZJnTK8UF97p9Qrh0G8EC4ozFtcKthL/xzcdDp1Sq7Wfd+Qh
 tqW8U9ZCJ/4m0STx72f2OaXjVf5SIlfswwhkYCRH+euhuRy6G7wqyxjARaVAUIIO+9
 9Vr0qQKWHy5DU+Q82htUStivJJgmY64ReNhxMWWel6+hum022iuFZS6WUm9hjvnEOr
 M/TGCueG6ZxLg==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9A08A12029C;
 Wed, 23 Sep 2020 14:44:55 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM>
Date: Wed, 23 Sep 2020 14:44:54 -0400
In-Reply-To: <20200923144824.GD6178@ACM> (Alan Mackenzie's message of "Wed, 23
 Sep 2020 14:48:24 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.056 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> It seems that as well as the existing variable
> comment-end-can-be-escaped, we need a new one, say
> line-comment-end-can-be-escaped, too.

syntax.c doesn't like to think of it as "line-comment" but rather as
comment stay a, b, c, or nested and non-nested.

> In C and C++ modes, these would
> be nil and t respectively.

I sm-c-mode, I'd handle those corner cases in
`syntax-propertize-function` (tho I think I don't bother with this one
currently).

So, I guess in CC-mode, you could handle those by placing `syntax-table`
properties from ... wherever you place them ;-)


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Sep 2020 19:45:02 +0000
Resent-Message-ID: <handler.43558.B43558.160089029232748 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160089029232748
          (code B ref 43558); Wed, 23 Sep 2020 19:45:02 +0000
Received: (at 43558) by debbugs.gnu.org; 23 Sep 2020 19:44:52 +0000
Received: from localhost ([127.0.0.1]:37924 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLAhA-0008W7-2g
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 15:44:52 -0400
Received: from colin.muc.de ([193.149.48.1]:36382 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kLAh6-0008Vi-UH
 for 43558 <at> debbugs.gnu.org; Wed, 23 Sep 2020 15:44:50 -0400
Received: (qmail 97817 invoked by uid 3782); 23 Sep 2020 19:44:42 -0000
Received: from acm.muc.de (p4fe156c4.dip0.t-ipconnect.de [79.225.86.196]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 23 Sep 2020 21:44:41 +0200
Received: (qmail 31789 invoked by uid 1000); 23 Sep 2020 19:44:41 -0000
Date: Wed, 23 Sep 2020 19:44:41 +0000
Message-ID: <20200923194441.GE6178@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Stefan.

On Wed, Sep 23, 2020 at 14:44:54 -0400, Stefan Monnier wrote:
> > It seems that as well as the existing variable
> > comment-end-can-be-escaped, we need a new one, say
> > line-comment-end-can-be-escaped, too.

> syntax.c doesn't like to think of it as "line-comment" but rather as
> comment stay [ ?? style ?? ] a, b, c, or nested and non-nested.

Hmm.  It could be quite troublesome to decide on an interface for major
modes specifying "comment style b can have its ender escaped, but
comment styles a and c cannot".

> > In C and C++ modes, these would
> > be nil and t respectively.

> I sm-c-mode, I'd handle those corner cases in
> `syntax-propertize-function` (tho I think I don't bother with this one
> currently).

> So, I guess in CC-mode, you could handle those by placing `syntax-table`
> properties from ... wherever you place them ;-)

Thanks, that's an idea - either putting a neutral s-t prop on the \ of
\*/, or something on the \n of \\n in a line comment.  I think the first
of these is a better idea than the second.

But on the other hand, it feels like a workaround for the lack of a
full-featured comment-end-can-be-escaped.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 23 Sep 2020 20:03:01 +0000
Resent-Message-ID: <handler.43558.B43558.16008913462691 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16008913462691
          (code B ref 43558); Wed, 23 Sep 2020 20:03:01 +0000
Received: (at 43558) by debbugs.gnu.org; 23 Sep 2020 20:02:26 +0000
Received: from localhost ([127.0.0.1]:37971 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLAyA-0000hL-9F
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2020 16:02:26 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38626)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kLAy8-0000h6-H1
 for 43558 <at> debbugs.gnu.org; Wed, 23 Sep 2020 16:02:24 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 46B7F80921;
 Wed, 23 Sep 2020 16:02:19 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 061E6814CD;
 Wed, 23 Sep 2020 16:02:18 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1600891338;
 bh=Jiadvwcb/PlVaJd0xAtYj8p8u2VxgZJLBnWyBMTNyqI=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=SsBmIqJA/WjJ4+ePaOH/JD4lCTIJfYxp1eJlqJZuDV3goH9jtnO2Oa96rS+Kd9fX0
 ixgLHji/NnfKLc1dUU6lr4oQ3M06LL8RCxvyGvQ9ovuRqCiZeC+VxdO1Iv1JpB5jh1
 v/Q/vo2UZ9KLjFnQtdarIE0Mxji7r1EcKovSFU5K20vI8DZcK00OG2t0AsB3o3MCum
 E6kE+gun5ThjXZILrZnDC7zL6FJt4OICYc5XK/fsklfiQgF85cT6pBaExSwP0TbkMe
 hsbRuL56x0u0PknNSIBS7TXDnW+XhHPiaHdUiBoElYImXFSJVGwscS5WUQeiAsun0i
 48qrK7XyRscmQ==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B76E21205CC;
 Wed, 23 Sep 2020 16:02:17 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvh7ros1ne.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200923194441.GE6178@ACM>
Date: Wed, 23 Sep 2020 16:02:16 -0400
In-Reply-To: <20200923194441.GE6178@ACM> (Alan Mackenzie's message of "Wed, 23
 Sep 2020 19:44:41 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.075 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> But on the other hand, it feels like a workaround for the lack of a

Yes, that's the definition of `syntax-propertize-function` ;-)


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 10:21:01 +0000
Resent-Message-ID: <handler.43558.B43558.16009428346543 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16009428346543
          (code B ref 43558); Thu, 24 Sep 2020 10:21:01 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 10:20:34 +0000
Received: from localhost ([127.0.0.1]:38679 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLOMc-0001hS-4k
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 06:20:34 -0400
Received: from colin.muc.de ([193.149.48.1]:38429 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kLOMY-0001h9-CM
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 06:20:33 -0400
Received: (qmail 43336 invoked by uid 3782); 24 Sep 2020 10:20:23 -0000
Received: from acm.muc.de (p4fe15b66.dip0.t-ipconnect.de [79.225.91.102]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 24 Sep 2020 12:20:22 +0200
Received: (qmail 4728 invoked by uid 1000); 24 Sep 2020 10:20:22 -0000
Date: Thu, 24 Sep 2020 10:20:22 +0000
Message-ID: <20200924102022.GA4714@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Stefan.

On Wed, Sep 23, 2020 at 14:44:54 -0400, Stefan Monnier wrote:
> > It seems that as well as the existing variable
> > comment-end-can-be-escaped, we need a new one, say
> > line-comment-end-can-be-escaped, too.

> syntax.c doesn't like to think of it as "line-comment" but rather as
> comment stay a, b, c, or nested and non-nested.

> > In C and C++ modes, these would be nil and t respectively.

> I sm-c-mode, I'd handle those corner cases in
> `syntax-propertize-function` (tho I think I don't bother with this one
> currently).

> So, I guess in CC-mode, you could handle those by placing `syntax-table`
> properties from ... wherever you place them ;-)

As already said, this is a(n ugly) workaround.  syntax.c should handle
comments in all their generality.  With a bit of consideration, the
method to do this is clear:

Introduce a new syntax flag `e' which takes effect in comment delimiters.
It means "escape characters are active in this type of comment".  In a
two character delimiter it would, like `b', only take effect on the inner
of the two characters.

So the syntaxes of the C++ comment characters would be amended to look
like
    /  ". 124be"
    *  ". 23"  (unchanged)
    \n "> be"

This would be an easy change to make, and (unlike using syntax-table text
properties) would cost negligible run time.

What do you think?

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 16:57:02 +0000
Resent-Message-ID: <handler.43558.B43558.16009666126486 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16009666126486
          (code B ref 43558); Thu, 24 Sep 2020 16:57:02 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 16:56:52 +0000
Received: from localhost ([127.0.0.1]:41512 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLUY8-0001gW-Jz
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 12:56:52 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kLUY7-0001gG-CC
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 12:56:51 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B412F100251;
 Thu, 24 Sep 2020 12:56:45 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 30521100096;
 Thu, 24 Sep 2020 12:56:44 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1600966604;
 bh=j989CJi0m0jSmlwtHzu4LISP2j1UjOPGBjYk84K8TJc=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=myycgk2pY7AQBHbh+cPXnxW8Hlczj3LSUNRC8p7bPJFQd/nGzUeWm+HHtbFTRipSw
 ikSs7+H7zoOtu3ZHLFyOl+ZV6lv4jRJiHsTI0VJifmbY/I5TKr0gH1RVIG0s3NSMMU
 otqOYn4aziXA1jWcb0wDAGpiskcNnle2ZxijagN+CN6N6gfbgYjUa4C1RivA7FqaRx
 p0DCMykCFsmToA9ulBydomc+DJtgaNYmB8JP6Q0J+4rOtv4+xaNwywFSy/kcMNws/j
 jGqdJB4M2BnHcHbaTkxlGl4l9mby1tH05/ZWlgal2S+5zlw+4YNIK93SKh6OwNEhvt
 KIjYM7/meWpQQ==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D3BEE12021C;
 Thu, 24 Sep 2020 12:56:43 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM>
Date: Thu, 24 Sep 2020 12:56:42 -0400
In-Reply-To: <20200924102022.GA4714@ACM> (Alan Mackenzie's message of "Thu, 24
 Sep 2020 10:20:22 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.049 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> As already said, this is a(n ugly) workaround.  syntax.c should handle
> comments in all their generality.  With a bit of consideration, the
> method to do this is clear:

In my world, it's quite normal for a specific language's lexical rules
not to line up 100% with syntax tables (whether for strings, comments,
younameit).  I don't see anything very special here.

A `syntax-propertize` rule for "\*/" should be very easy to implement
and fairly cheap since the regexp is simple and will almost never match.

So, yeah, you can add yet-another-hack on top of the other syntax.c
hacks if you want, but there's a good chance it will only ever be used
by CC-mode.  It will take a lot more code changes in syntax.c than
a quick tweak to your Elisp code to search for "\*/".

I do think it would be good to handle this without `syntax-table`
text-property hacks, but I think that should come with an overhaul of
syntax.c based on a major-mode provided DFA (or something like that) so
it can accommodate all the various oddball cases without even the need
to introduce the notion of escaping comment markers.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 18:51:02 +0000
Resent-Message-ID: <handler.43558.B43558.160097344117599 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160097344117599
          (code B ref 43558); Thu, 24 Sep 2020 18:51:02 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 18:50:41 +0000
Received: from localhost ([127.0.0.1]:41742 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLWKH-0004Zn-4x
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 14:50:41 -0400
Received: from colin.muc.de ([193.149.48.1]:38311 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kLWKF-0004ZX-Dx
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 14:50:40 -0400
Received: (qmail 34526 invoked by uid 3782); 24 Sep 2020 18:50:32 -0000
Received: from acm.muc.de (p4fe15b66.dip0.t-ipconnect.de [79.225.91.102]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 24 Sep 2020 20:50:31 +0200
Received: (qmail 30966 invoked by uid 1000); 24 Sep 2020 18:50:31 -0000
Date: Thu, 24 Sep 2020 18:50:31 +0000
Message-ID: <20200924185031.GB4714@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Stefan.

On Thu, Sep 24, 2020 at 12:56:42 -0400, Stefan Monnier wrote:
> > As already said, this is a(n ugly) workaround.  syntax.c should handle
> > comments in all their generality.  With a bit of consideration, the
> > method to do this is clear:

> In my world, it's quite normal for a specific language's lexical rules
> not to line up 100% with syntax tables (whether for strings, comments,
> younameit).  I don't see anything very special here.

Normally when there's a mismatch, it's because a character is
syntactically ambiguous.  There's nothing syntax.c can do about this.

In the current situation, this isn't the case: syntax.c is unable to
handle a comment scenario where there is no ambiguity.

> A `syntax-propertize` rule for "\*/" should be very easy to implement
> and fairly cheap since the regexp is simple and will almost never match.

Well, the rule would actually be for escaped newlines, but this would be
quite expensive (compared with a syntax.c solution) since every comment
near a change region would need scanning at each change.

> So, yeah, you can add yet-another-hack on top of the other syntax.c
> hacks if you want, but there's a good chance it will only ever be used
> by CC-mode.  It will take a lot more code changes in syntax.c than
> a quick tweak to your Elisp code to search for "\*/".

I've hacked up a working, but as yet unsatisfactory, change to syntax.c.
It is surely better, where possible, to fix bugs at their point of
causation rather than by workarounds elsewhere.  As you note, CC Mode
modes will be the only known users at the moment.

Just as an aside, the project where I was working ~four years ago banned
a proprietory editor after a mammoth search for a bug caused by an
unintentional escaped NL on a line comment.  The banned editor didn't
fontify the continuation line in comment face.  I was able to
demonstrate to the project manager that Emacs fontified that comment
correctly.

> I do think it would be good to handle this without `syntax-table`
> text-property hacks, but I think that should come with an overhaul of
> syntax.c based on a major-mode provided DFA (or something like that) so
> it can accommodate all the various oddball cases without even the need
> to introduce the notion of escaping comment markers.

That sounds almost more like a rewrite than an overhaul.  You mean, I
think, that the syntax of language expressions would be defined using
something a bit like (but more powerful than) regular expressions.  And
with that, the need for syntactic analysis in Lisp would be much
reduced.

We would need to make sure that this wouldn't run more slowly than the
current syntax.c/Lisp combination.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Michael Welsh Duggan <mwd@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 18:53:02 +0000
Resent-Message-ID: <handler.43558.B43558.160097354917761 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160097354917761
          (code B ref 43558); Thu, 24 Sep 2020 18:53:02 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 18:52:29 +0000
Received: from localhost ([127.0.0.1]:41746 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLWM1-0004cP-I9
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 14:52:29 -0400
Received: from md5i.com ([75.151.244.229]:40480)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mwd@HIDDEN>) id 1kLWLz-0004cH-Og
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 14:52:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com;
 s=dkim; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=TgXUxapiN/8MkQPCduD01bJMXu8bXBFxLWRxxDpbGqo=; b=vE5my4PR2EPM/gdZKvw9iP2aOV
 5R84+ZqYr9TXeB4Dd121gKN+7fEGR/n9Q+O3O2caKTyBC0esMOcQta37oCKhpqiwRsXp11TByO/AI
 oLPteE8luufnlijjI3xMmf+rX;
Received: from md5i by md5i.com with local (Exim 4.94)
 (envelope-from <mwd@HIDDEN>)
 id 1kLWLo-005242-Gm; Thu, 24 Sep 2020 14:52:16 -0400
From: Michael Welsh Duggan <mwd@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM>
Date: Thu, 24 Sep 2020 14:52:16 -0400
In-Reply-To: <20200923144824.GD6178@ACM> (Alan Mackenzie's message of "Wed, 23
 Sep 2020 14:48:24 +0000")
Message-ID: <87v9g3yplr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Mattias.
>
> On Wed, Sep 23, 2020 at 11:01:59 +0200, Mattias Engdeg=E5rd wrote:
>> Sorry if I misunderstood, but since when do backslashes escape */ in C?
>
> Since forever, but only in the CC Mode test suite.  :-(
>
> I just tried it out with gcc, and it seems that \*/ does indeed end a
> block comment.  But an escaped newline doesn't end a line comment,
> instead continuing it to the next line.  So I got confused.  Thanks for
> pointing out the mistake.
>
> It seems that as well as the existing variable
> comment-end-can-be-escaped, we need a new one, say
> line-comment-end-can-be-escaped, too.  In C and C++ modes, these would
> be nil and t respectively.

But where does it say that backslashes escape */ in C++?  The C++ 14
standard (and it hasn't changed through C++ 20) says:

    2.7 Comments [lex.comment]
=20=20=20=20
    The characters /* start a comment, which terminates with the
    characters */. These comments do not nest.  The characters // start
    a comment, which terminates immediately before the next new-line
    character. If there is a form-feed or a vertical-tab character in
    such a comment, only white-space characters shall appear between it
    and the new-line that terminates the comment; no diagnostic is
    required. [ Note: The comment characters //, /*, and */ have no
    special meaning within a // comment and are treated just like other
    characters. Similarly, the comment characters // and /* have no
    special meaning within a /* comment.  =97 end note ]

--=20
Michael Welsh Duggan
(md5i@HIDDEN)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 19:58:02 +0000
Resent-Message-ID: <handler.43558.B43558.16009774717462 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Michael Welsh Duggan <mwd@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16009774717462
          (code B ref 43558); Thu, 24 Sep 2020 19:58:02 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 19:57:51 +0000
Received: from localhost ([127.0.0.1]:41811 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLXNG-0001wH-RJ
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 15:57:51 -0400
Received: from colin.muc.de ([193.149.48.1]:41804 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kLXNF-0001w3-8K
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 15:57:49 -0400
Received: (qmail 78094 invoked by uid 3782); 24 Sep 2020 19:57:42 -0000
Received: from acm.muc.de (p4fe15b66.dip0.t-ipconnect.de [79.225.91.102]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 24 Sep 2020 21:57:42 +0200
Received: (qmail 31210 invoked by uid 1000); 24 Sep 2020 19:57:42 -0000
Date: Thu, 24 Sep 2020 19:57:42 +0000
Message-ID: <20200924195742.GC4714@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <87v9g3yplr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87v9g3yplr.fsf@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Michael.

On Thu, Sep 24, 2020 at 14:52:16 -0400, Michael Welsh Duggan wrote:
> Alan Mackenzie <acm@HIDDEN> writes:

> > On Wed, Sep 23, 2020 at 11:01:59 +0200, Mattias Engdegård wrote:
> >> Sorry if I misunderstood, but since when do backslashes escape */ in C?

> > Since forever, but only in the CC Mode test suite.  :-(

> > I just tried it out with gcc, and it seems that \*/ does indeed end a
> > block comment.  But an escaped newline doesn't end a line comment,
> > instead continuing it to the next line.  So I got confused.  Thanks for
> > pointing out the mistake.

> > It seems that as well as the existing variable
> > comment-end-can-be-escaped, we need a new one, say
> > line-comment-end-can-be-escaped, too.  In C and C++ modes, these would
> > be nil and t respectively.

> But where does it say that backslashes escape */ in C++?

Nowhere.  :-(

There has been a test in the CC Mode test suite for many years which
assumed this (but was disabled for existing (X)Emacs versions, waiting
for a new Emacs version to be "fixed").

> The C++ 14 standard (and it hasn't changed through C++ 20) says:

>     2.7 Comments [lex.comment]
    
>     The characters /* start a comment, which terminates with the
>     characters */. These comments do not nest.  The characters // start
>     a comment, which terminates immediately before the next new-line
>     character.

For all the difference it makes, Emacs assumes the comment ends _after_
the NL.

>     If there is a form-feed or a vertical-tab character in such a
>     comment, only white-space characters shall appear between it and
>     the new-line that terminates the comment; no diagnostic is
>     required.

I didn't know that.  Emacs/CC Mode doesn't code up this subtlety.  It
probably isn't worth bothering about.

>     [ Note: The comment characters //, /*, and */ have no special
>     meaning within a // comment and are treated just like other
>     characters. Similarly, the comment characters // and /* have no
>     special meaning within a /* comment.  — end note ]

Additionally, an escaped newline continues a comment onto the next line.
This happens, notionally, at a very early stage of compilation where a
backslash followed by NL anywhere get replaced by a space.  I think that
even two backslashes followed by NL would get replaced by backslash,
space.

> -- 
> Michael Welsh Duggan
> (md5i@HIDDEN)

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Michael Welsh Duggan <mwd@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 20:29:02 +0000
Resent-Message-ID: <handler.43558.B43558.160097928710407 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: Michael Welsh Duggan <mwd@HIDDEN>, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, "43558 <at> debbugs.gnu.org" <43558 <at> debbugs.gnu.org>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160097928710407
          (code B ref 43558); Thu, 24 Sep 2020 20:29:02 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 20:28:07 +0000
Received: from localhost ([127.0.0.1]:41899 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLXqY-0002hn-MO
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 16:28:06 -0400
Received: from veto.sei.cmu.edu ([147.72.252.17]:56112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mwd@HIDDEN>) id 1kLXqT-0002hE-BE
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 16:28:04 -0400
Received: from korb.sei.cmu.edu (korb.sei.cmu.edu [10.64.21.30])
 by veto.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id 08OKRpRQ004974;
 Thu, 24 Sep 2020 16:27:51 -0400
DKIM-Filter: OpenDKIM Filter v2.11.0 veto.sei.cmu.edu 08OKRpRQ004974
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cert.org;
 s=yc2bmwvrj62m; t=1600979272;
 bh=vlj8poS9fa2fSE/vU43Rz9kFRxlSgMC2A8WUTyv4tls=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=CGpsxJQ/AftZ/FGc+D4Dhzsfa6jIsLxsAFm3XdJuoU4xdlfqqUFbZWG880nRRF4Eq
 +Jc6vLdjv4AsiF9+kV7ctwV5farNqRhHaPdLz39Ao0uUMyrxK2gO4bD8Z37Y2CgiT/
 FWSpxDCzykOWnJ4cynh243vpqVZDwVH2JPofxggs=
Received: from lx-birch.ad.sei.cmu.edu (lx-birch.ad.sei.cmu.edu [10.64.53.120])
 by korb.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id 08OKRnrk022482;
 Thu, 24 Sep 2020 16:27:49 -0400
Received: from lx-birch.ad.sei.cmu.edu (localhost [127.0.0.1])
 by lx-birch.ad.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id 08OKRmkP026517;
 Thu, 24 Sep 2020 16:27:48 -0400
Received: (from mwd@localhost)
 by lx-birch.ad.sei.cmu.edu (8.14.7/8.14.7) id 08OKRmSW026514;
 Thu, 24 Sep 2020 16:27:48 -0400
X-Authentication-Warning: lx-birch.ad.sei.cmu.edu: mwd set sender to
 mwd@HIDDEN using -f
From: Michael Welsh Duggan <mwd@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <87v9g3yplr.fsf@HIDDEN>
 <20200924195742.GC4714@ACM>
Date: Thu, 24 Sep 2020 16:27:48 -0400
In-Reply-To: <20200924195742.GC4714@ACM> (Alan Mackenzie's message of "Thu, 24
 Sep 2020 15:57:42 -0400")
Message-ID: <y2tdefr1qqc43f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Michael.
>
> On Thu, Sep 24, 2020 at 14:52:16 -0400, Michael Welsh Duggan wrote:
>> Alan Mackenzie <acm@HIDDEN> writes:
>
>> > On Wed, Sep 23, 2020 at 11:01:59 +0200, Mattias Engdeg=C3=A5rd wrote:
>> >> Sorry if I misunderstood, but since when do backslashes escape */ in =
C?
>
>> > Since forever, but only in the CC Mode test suite.  :-(
>
>> > I just tried it out with gcc, and it seems that \*/ does indeed end a
>> > block comment.  But an escaped newline doesn't end a line comment,
>> > instead continuing it to the next line.  So I got confused.  Thanks for
>> > pointing out the mistake.
>
>> > It seems that as well as the existing variable
>> > comment-end-can-be-escaped, we need a new one, say
>> > line-comment-end-can-be-escaped, too.  In C and C++ modes, these would
>> > be nil and t respectively.
>
>> But where does it say that backslashes escape */ in C++?
>
> Nowhere.  :-(
>
> There has been a test in the CC Mode test suite for many years which
> assumed this (but was disabled for existing (X)Emacs versions, waiting
> for a new Emacs version to be "fixed").
>
>> The C++ 14 standard (and it hasn't changed through C++ 20) says:
>
>>     2.7 Comments [lex.comment]
>=20=20=20=20=20
>>     The characters /* start a comment, which terminates with the
>>     characters */. These comments do not nest.  The characters // start
>>     a comment, which terminates immediately before the next new-line
>>     character.
>
> For all the difference it makes, Emacs assumes the comment ends _after_
> the NL.
>
>>     If there is a form-feed or a vertical-tab character in such a
>>     comment, only white-space characters shall appear between it and
>>     the new-line that terminates the comment; no diagnostic is
>>     required.
>
> I didn't know that.  Emacs/CC Mode doesn't code up this subtlety.  It
> probably isn't worth bothering about.
>
>>     [ Note: The comment characters //, /*, and */ have no special
>>     meaning within a // comment and are treated just like other
>>     characters. Similarly, the comment characters // and /* have no
>>     special meaning within a /* comment.  =E2=80=94 end note ]
>
> Additionally, an escaped newline continues a comment onto the next line.
> This happens, notionally, at a very early stage of compilation where a
> backslash followed by NL anywhere get replaced by a space.  I think that
> even two backslashes followed by NL would get replaced by backslash,
> space.

Almost.  A backslash followed by a newline is elided completely, joining
the lines.  (Not replaced by a space.  Otherwise, I concur.

--=20
Michael Welsh Duggan
(mwd@HIDDEN)




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 24 Sep 2020 22:44:02 +0000
Resent-Message-ID: <handler.43558.B43558.160098739930742 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160098739930742
          (code B ref 43558); Thu, 24 Sep 2020 22:44:02 +0000
Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 22:43:19 +0000
Received: from localhost ([127.0.0.1]:41979 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kLZxP-0007zm-5F
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2020 18:43:19 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18767)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kLZxJ-0007zV-HV
 for 43558 <at> debbugs.gnu.org; Thu, 24 Sep 2020 18:43:17 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BF71A10022C;
 Thu, 24 Sep 2020 18:43:07 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CF3F510001F;
 Thu, 24 Sep 2020 18:43:05 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1600987385;
 bh=3wV5sFDgj3Czxfyv5P1FY4gFnJ5zDFJNt/56La2tabA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=b8u19j7cZ0PQo9sXbFgeSJO7dkP4Kii0y54gsrJxkn/7ubjBdDTB/t/7rY1Gy+q/q
 YisKPn1F0oLoTpfeSir8TT/FVtZ5OO/12eoxI3yaw34r6PVhnSwYE6WDnvSRSeWmKA
 ZyD+5LLW8BA+HnV3fG/Z1755j1LDciW7Ehz+cLXsAvKIlFrHVR/AgBaphL5HPY6wnH
 2LjmLrdNw7mi9QDkiF+9Rz39Lwc0lBZ+5OZHhnt2mAi0q5rIPmOgy+e7LM9qt9xp87
 ufg26fGy6EwEiyjgKnV/BSdK47pbyGQFTcDKfeoABqV1+Iatl0UZxgJgYfL1ikZi1w
 lVSD8dy0eSEww==
Received: from alfajor (unknown [45.72.232.131])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 938F11203B2;
 Thu, 24 Sep 2020 18:43:05 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwv3636n7b9.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20200924185031.GB4714@ACM>
Date: Thu, 24 Sep 2020 18:43:04 -0400
In-Reply-To: <20200924185031.GB4714@ACM> (Alan Mackenzie's message of "Thu, 24
 Sep 2020 18:50:31 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.051 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> > As already said, this is a(n ugly) workaround.  syntax.c should handle
>> > comments in all their generality.  With a bit of consideration, the
>> > method to do this is clear:
>> In my world, it's quite normal for a specific language's lexical rules
>> not to line up 100% with syntax tables (whether for strings, comments,
>> younameit).  I don't see anything very special here.
> Normally when there's a mismatch, it's because a character is
> syntactically ambiguous.  There's nothing syntax.c can do about this.

Oh, no, there are many more situations than just "a character is
syntactically ambiguous" (or alternatively you could argue that all
cases are "a character is syntactically ambiguous", including your cases
of escaped newline and escaped */).

>> A `syntax-propertize` rule for "\*/" should be very easy to implement
>> and fairly cheap since the regexp is simple and will almost never match.
> Well, the rule would actually be for escaped newlines,

It doesn't have to be if you set `comment-end-can-be-escaped` to non-nil,
in which case you only need to tweak the \*/ case, AFAICT.

> but this would be quite expensive (compared with a syntax.c solution)
> since every comment near a change region would need scanning at
> each change.

I don't know what you mean by scanning, but yes you'd need to search for
all "\\\\\n" or "\\\\\\*/" (depending on how you set
`comment-end-can-be-escaped) and mark the second char accordingly.
Seems pretty cheap in either case.

> I've hacked up a working, but as yet unsatisfactory, change to syntax.c.
> It is surely better, where possible, to fix bugs at their point of
> causation rather than by workarounds elsewhere.

I don't think it's a bug in `syntax.c`.  `syntax.c` is not defined to
support the syntax of C, it's only defined to handle a particular set of
comment and string styles, which correspond to a common subset of what
is in use in most languages, but IME most languages need some extra
tweaks handled via the `syntax-table` text property.  It's only
a question of time until we add a `syntax-propertize-function` for Elisp
mode to properly handle some corner cases, for example.

>> I do think it would be good to handle this without `syntax-table`
>> text-property hacks, but I think that should come with an overhaul of
>> syntax.c based on a major-mode provided DFA (or something like that) so
>> it can accommodate all the various oddball cases without even the need
>> to introduce the notion of escaping comment markers.
> That sounds almost more like a rewrite than an overhaul.

Tomato tomahto.

> We would need to make sure that this wouldn't run more slowly than the
> current syntax.c/Lisp combination.

I don't think that would be required, as long as it runs fast enough.
In any case, the resulting performance is probably not the main worry
(I suspect it will/would be easy to make it fast enough).


        Stefan





Message received at fakecontrol@fakecontrolmessage:


Received: (at fakecontrol) by fakecontrolmessage;
To: internal_control <at> debbugs.gnu.org
From: Debbugs Internal Request <help-debbugs@HIDDEN>
Subject: Internal Control
Message-Id: bug archived.
Date: Fri, 23 Oct 2020 11:24:06 +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


Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 19 Nov 2020 21:28:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 19 16:28:10 2020
Received: from localhost ([127.0.0.1]:41176 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfrTO-00072B-LQ
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2020 16:28:10 -0500
Received: from colin.muc.de ([193.149.48.1]:26198 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kfrTN-00071x-BD
 for control <at> debbugs.gnu.org; Thu, 19 Nov 2020 16:28:09 -0500
Received: (qmail 31360 invoked by uid 3782); 19 Nov 2020 21:28:02 -0000
Received: from acm.muc.de (p4fe153fb.dip0.t-ipconnect.de [79.225.83.251]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 19 Nov 2020 22:28:02 +0100
Received: (qmail 28701 invoked by uid 1000); 19 Nov 2020 21:28:02 -0000
Date: Thu, 19 Nov 2020 21:28:02 +0000
To: control <at> debbugs.gnu.org
Subject: Reopen bug 43558: [PATCH]: Fix (forward-comment 1) when end
 delimiter is escaped.
Message-ID: <20201119212802.GF6259@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

unarchive 43558
reopen 43558
quit

-- 
Alan Mackenzie (Nuremberg, Germany).




Message received at fakecontrol@fakecontrolmessage:


Received: (at fakecontrol) by fakecontrolmessage;
To: internal_control <at> debbugs.gnu.org
From: Debbugs Internal Request <help-debbugs@HIDDEN>
Subject: Internal Control
Message-Id: Did not alter fixed versions and reopened.
Date: Thu, 19 Nov 2020 21:29:02 +0000
User-Agent: Fakemail v42.6.9

# This is a fake control message.
#
# The action:
# Did not alter fixed versions and reopened.
thanks
# This fakemail brought to you by your local debbugs
# administrator


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 19 Nov 2020 21:32:02 +0000
Resent-Message-ID: <handler.43558.B43558.16058215191170 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, acm@HIDDEN
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16058215191170
          (code B ref 43558); Thu, 19 Nov 2020 21:32:02 +0000
Received: (at 43558) by debbugs.gnu.org; 19 Nov 2020 21:31:59 +0000
Received: from localhost ([127.0.0.1]:41182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfrX4-0000IC-2q
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2020 16:31:58 -0500
Received: from colin.muc.de ([193.149.48.1]:26351 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kfrX1-0000By-KD
 for 43558 <at> debbugs.gnu.org; Thu, 19 Nov 2020 16:31:56 -0500
Received: (qmail 33276 invoked by uid 3782); 19 Nov 2020 21:31:50 -0000
Received: from acm.muc.de (p4fe153fb.dip0.t-ipconnect.de [79.225.83.251]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 19 Nov 2020 22:31:49 +0100
Received: (qmail 28724 invoked by uid 1000); 19 Nov 2020 21:31:49 -0000
Resent-Date: Thu, 19 Nov 2020 21:31:49 +0000
Resent-Message-ID: <20201119213149.GA28101@ACM>
Resent-To: 43558 <at> debbugs.gnu.org
Date: Thu, 19 Nov 2020 21:18:22 +0000
From: Alan Mackenzie <acm@HIDDEN>
Message-ID: <20201119211822.GE6259@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
Resent-From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Stefan.

On Thu, Sep 24, 2020 at 12:56:42 -0400, Stefan Monnier wrote:
> > As already said, this is a(n ugly) workaround.  syntax.c should handle
> > comments in all their generality.  With a bit of consideration, the
> > method to do this is clear:

> In my world, it's quite normal for a specific language's lexical rules
> not to line up 100% with syntax tables (whether for strings, comments,
> younameit).  I don't see anything very special here.

> A `syntax-propertize` rule for "\*/" should be very easy to implement
> and fairly cheap since the regexp is simple and will almost never match.

> So, yeah, you can add yet-another-hack on top of the other syntax.c
> hacks if you want, but there's a good chance it will only ever be used
> by CC-mode.  It will take a lot more code changes in syntax.c than
> a quick tweak to your Elisp code to search for "\*/".

> I do think it would be good to handle this without `syntax-table`
> text-property hacks, but I think that should come with an overhaul of
> syntax.c based on a major-mode provided DFA (or something like that) so
> it can accommodate all the various oddball cases without even the need
> to introduce the notion of escaping comment markers.

OK, here's the patch.  As a matter of interest, it's been heavily tested
by the .../test/src/syntax-tests.el unit tests, further enhancements to
which are part of the patch.

Just as a reminder, the motivation is to be able to have syntax.c
correctly parse C/C++ line comments which look like:

    foo(); // comment \\
    second line of comment.

by introducing a new syntax flag "e" as a modifier on the syntax entry
for \n:

    (modify-syntax-entry ?\n "> be")

>         Stefan



diff --git a/src/syntax.c b/src/syntax.c
index df07809aaa..c701729ba1 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -108,6 +108,11 @@ SYNTAX_FLAGS_COMMENT_NESTED (int flags)
 {
   return (flags >> 22) & 1;
 }
+static bool
+SYNTAX_FLAGS_COMMENT_ESCAPES (int flags)
+{
+  return (flags >> 24) & 1;
+}
 
 /* FLAGS should be the flags of the main char of the comment marker, e.g.
    the second for comstart and the first for comend.  */
@@ -673,6 +678,26 @@ prev_char_comend_first (ptrdiff_t pos, ptrdiff_t pos_byte)
   return val;
 }
 
+static bool
+comment_ender_quoted (ptrdiff_t from, ptrdiff_t from_byte, int syntax)
+{
+  int c;
+  int next_syntax;
+  if (comment_end_can_be_escaped && char_quoted (from, from_byte))
+    return true;
+  if (SYNTAX_FLAGS_COMMENT_ESCAPES (syntax))
+    {
+      dec_both (&from, &from_byte);
+      UPDATE_SYNTAX_TABLE_BACKWARD (from);
+      c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
+      next_syntax = SYNTAX_WITH_FLAGS (c);
+      UPDATE_SYNTAX_TABLE_FORWARD (from + 1);
+      if (next_syntax == Sescape || next_syntax == Scharquote)
+        return true;
+    }
+  return false;
+}
+
 /* Check whether charpos FROM is at the end of a comment.
    FROM_BYTE is the bytepos corresponding to FROM.
    Do not move back before STOP.
@@ -755,6 +780,20 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
 		 && SYNTAX_FLAGS_COMEND_SECOND (prev_syntax));
       comstart = (com2start || code == Scomment);
 
+      /* Check for any current delimiter being escaped.  */
+      if (from > stop
+          && (((com2end || code == Sendcomment)
+               && comment_ender_quoted (from, from_byte, syntax))
+              || (code == Scomment
+                  && comment_end_can_be_escaped
+                  && char_quoted (from, from_byte))))
+        {
+          dec_both (&from, &from_byte);
+          UPDATE_SYNTAX_TABLE_BACKWARD (from);
+          com2end = comstart = com2start = 0;
+          syntax = Smax;
+        }
+
       /* Nasty cases with overlapping 2-char comment markers:
 	 - snmp-mode: -- c -- foo -- c --
 	              --- c --
@@ -1191,6 +1230,10 @@ the value of a `syntax-table' text property.  */)
       case 'c':
 	val |= 1 << 23;
 	break;
+
+      case 'e':
+        val |= 1 << 24;
+        break;
       }
 
   if (val < ASIZE (Vsyntax_code_object) && NILP (match))
@@ -1279,7 +1322,8 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
   (Lisp_Object syntax)
 {
   int code, syntax_code;
-  bool start1, start2, end1, end2, prefix, comstyleb, comstylec, comnested;
+  bool start1, start2, end1, end2, prefix, comstyleb, comstylec, comnested,
+    comescapes;
   char str[2];
   Lisp_Object first, match_lisp, value = syntax;
 
@@ -1320,6 +1364,7 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
   comstyleb = SYNTAX_FLAGS_COMMENT_STYLEB (syntax_code);
   comstylec = SYNTAX_FLAGS_COMMENT_STYLEC (syntax_code);
   comnested = SYNTAX_FLAGS_COMMENT_NESTED (syntax_code);
+  comescapes = SYNTAX_FLAGS_COMMENT_ESCAPES (syntax_code);
 
   if (Smax <= code)
     {
@@ -1353,6 +1398,8 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
     insert ("c", 1);
   if (comnested)
     insert ("n", 1);
+  if (comescapes)
+    insert ("e", 1);
 
   insert_string ("\twhich means: ");
 
@@ -1416,6 +1463,8 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
     insert_string (" (comment style c)");
   if (comnested)
     insert_string (" (nestable)");
+  if (comescapes)
+    insert_string (" (can be escaped)");
 
   if (prefix)
     {
@@ -2336,7 +2385,7 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
 	  && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style
 	  && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ?
 	      (nesting > 0 && --nesting == 0) : nesting < 0)
-          && !(comment_end_can_be_escaped && char_quoted (from, from_byte)))
+          && !comment_ender_quoted (from, from_byte, syntax))
 	/* We have encountered a comment end of the same style
 	   as the comment sequence which began this comment
 	   section.  */
@@ -2354,12 +2403,12 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
 	/* We have encountered a nested comment of the same style
 	   as the comment sequence which began this comment section.  */
 	nesting++;
-      if (comment_end_can_be_escaped
-          && (code == Sescape || code == Scharquote))
+      if (SYNTAX_FLAGS_COMEND_FIRST (syntax)
+          && comment_ender_quoted (from, from_byte, syntax))
         {
           inc_both (&from, &from_byte);
           UPDATE_SYNTAX_TABLE_FORWARD (from);
-          if (from == stop) continue; /* Failure */
+          continue;
         }
       inc_both (&from, &from_byte);
       UPDATE_SYNTAX_TABLE_FORWARD (from);
@@ -2493,8 +2542,8 @@ between them, return t; otherwise return nil.  */)
       /* We're at the start of a comment.  */
       found = forw_comment (from, from_byte, stop, comnested, comstyle, 0,
 			    &out_charpos, &out_bytepos, &dummy, &dummy2);
-      from = out_charpos; from_byte = out_bytepos;
-      if (!found)
+      from = out_charpos; from_byte = out_bytepos; 
+     if (!found)
 	{
 	  SET_PT_BOTH (from, from_byte);
 	  return Qnil;
@@ -2526,21 +2575,27 @@ between them, return t; otherwise return nil.  */)
 	  if (code == Sendcomment)
 	    comstyle = SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0);
 	  if (from > stop && SYNTAX_FLAGS_COMEND_SECOND (syntax)
-	      && prev_char_comend_first (from, from_byte)
-	      && !char_quoted (from - 1, dec_bytepos (from_byte)))
+	      && prev_char_comend_first (from, from_byte))
 	    {
 	      int other_syntax;
-	      /* We must record the comment style encountered so that
+              /* We must record the comment style encountered so that
 		 later, we can match only the proper comment begin
 		 sequence of the same style.  */
 	      dec_both (&from, &from_byte);
-	      code = Sendcomment;
-	      /* Calling char_quoted, above, set up global syntax position
-		 at the new value of FROM.  */
 	      c1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
 	      other_syntax = SYNTAX_WITH_FLAGS (c1);
-	      comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
-	      comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
+              if (!comment_ender_quoted (from, from_byte, other_syntax))
+                {
+                  code = Sendcomment;
+                  comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
+                  comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
+                  syntax = other_syntax;
+                }
+              else
+                {
+                  inc_both (&from, &from_byte);
+                  UPDATE_SYNTAX_TABLE_FORWARD (from);
+                }
 	    }
 
 	  if (code == Scomment_fence)
@@ -2579,7 +2634,8 @@ between them, return t; otherwise return nil.  */)
 	    }
 	  else if (code == Sendcomment)
 	    {
-              found = (!quoted || !comment_end_can_be_escaped)
+              found =
+                !comment_ender_quoted (from, from_byte, syntax)
                 && back_comment (from, from_byte, stop, comnested, comstyle,
                                  &out_charpos, &out_bytepos);
 	      if (!found)
@@ -2864,6 +2920,7 @@ scan_lists (EMACS_INT from0, EMACS_INT count, EMACS_INT depth, bool sexpflag)
 	      other_syntax = SYNTAX_WITH_FLAGS (c2);
 	      comstyle = SYNTAX_FLAGS_COMMENT_STYLE (other_syntax, syntax);
 	      comnested |= SYNTAX_FLAGS_COMMENT_NESTED (other_syntax);
+              syntax = other_syntax;
 	    }
 
 	  /* Quoting turns anything except a comment-ender
@@ -2946,7 +3003,10 @@ scan_lists (EMACS_INT from0, EMACS_INT count, EMACS_INT depth, bool sexpflag)
 	    case Sendcomment:
 	      if (!parse_sexp_ignore_comments)
 		break;
-	      found = back_comment (from, from_byte, stop, comnested, comstyle,
+	      found =
+                (from == stop
+                 || !comment_ender_quoted (from, from_byte, syntax))
+                && back_comment (from, from_byte, stop, comnested, comstyle,
 				    &out_charpos, &out_bytepos);
 	      /* FIXME:  if !found, it really wasn't a comment-end.
 		 For single-char Sendcomment, we can't do much about it apart
diff --git a/test/src/syntax-resources/syntax-comments.txt b/test/src/syntax-resources/syntax-comments.txt
index a292d816b9..f3357ea244 100644
--- a/test/src/syntax-resources/syntax-comments.txt
+++ b/test/src/syntax-resources/syntax-comments.txt
@@ -34,7 +34,7 @@
 54{ //74 \
 }54
 55{/* */}55
-56{ /*76 \*/ }56
+56{ /*76 \*/80 }56
 57*/77
 58}58
 60{ /*78 \\*/79}60
@@ -87,6 +87,21 @@
 110
 111#| ; |#111
 
+/* Comments and purported comments containing string delimiters. */
+120/* "string" */120
+121/* "" */121
+122/* " */122
+130/*
+" " */130
+" "*/123
+124/* " ' */124
+126/*
+" ' */126
+127/* " " " " " */127
+128/* " ' "  ' " ' */128
+129/*   ' "  ' " ' */129
+" ' */125
+
 Local Variables:
 mode: fundamental
 eval: (set-syntax-table (make-syntax-table))
diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el
index edee01ec58..399986c31d 100644
--- a/test/src/syntax-tests.el
+++ b/test/src/syntax-tests.el
@@ -307,6 +307,7 @@ syntax-pps-comments
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun {-in ()
   (setq parse-sexp-ignore-comments t)
+  (setq comment-use-syntax-ppss nil)
   (setq comment-end-can-be-escaped nil)
   (modify-syntax-entry ?{ "<")
   (modify-syntax-entry ?} ">"))
@@ -336,6 +337,7 @@ {-out
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun \;-in ()
   (setq parse-sexp-ignore-comments t)
+  (setq comment-use-syntax-ppss nil)
   (setq comment-end-can-be-escaped nil)
   (modify-syntax-entry ?\n ">")
   (modify-syntax-entry ?\; "<")
@@ -375,6 +377,7 @@ \;-out
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun \#|-in ()
   (setq parse-sexp-ignore-comments t)
+  (setq comment-use-syntax-ppss nil)
   (modify-syntax-entry ?# ". 14")
   (modify-syntax-entry ?| ". 23n")
   (modify-syntax-entry ?\; "< b")
@@ -418,15 +421,18 @@ \#|-out
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun /*-in ()
   (setq parse-sexp-ignore-comments t)
+  (setq comment-use-syntax-ppss nil)
   (setq comment-end-can-be-escaped t)
   (modify-syntax-entry ?/ ". 124b")
   (modify-syntax-entry ?* ". 23")
-  (modify-syntax-entry ?\n "> b"))
+  (modify-syntax-entry ?\n "> b")
+  (modify-syntax-entry ?\' "\""))
 (defun /*-out ()
   (setq comment-end-can-be-escaped nil)
   (modify-syntax-entry ?/ ".")
   (modify-syntax-entry ?* ".")
-  (modify-syntax-entry ?\n " "))
+  (modify-syntax-entry ?\n " ")
+  (modify-syntax-entry ?\' "."))
 (eval-and-compile
   (setq syntax-comments-section "c"))
 
@@ -489,4 +495,142 @@ /*-out
 (syntax-pps-comments /* 56 76 77 58)
 (syntax-pps-comments /* 60 78 79)
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Emacs 28 "C" style comments - `comment-end-can-be-escaped' is nil, the
+;; "e" flag is used for line comments.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun //-in ()
+  (setq parse-sexp-ignore-comments t)
+  (setq comment-use-syntax-ppss nil)
+  (modify-syntax-entry ?/ ". 124be")
+  (modify-syntax-entry ?* ". 23")
+  (modify-syntax-entry ?\n "> be")
+  (modify-syntax-entry ?\' "\""))
+(defun //-out ()
+  (modify-syntax-entry ?/ ".")
+  (modify-syntax-entry ?* ".")
+  (modify-syntax-entry ?\n " ")
+  (modify-syntax-entry ?\' "."))
+(eval-and-compile
+  (setq syntax-comments-section "c++"))
+
+(syntax-comments // forward t 1)
+(syntax-comments // backward t 1)
+(syntax-comments // forward t 2)
+(syntax-comments // backward t 2)
+(syntax-comments // forward t 3)
+(syntax-comments // backward t 3)
+
+(syntax-comments // forward t 4)
+(syntax-comments // backward t 4)
+(syntax-comments // forward t 5 6)
+(syntax-comments // backward nil 5 0)
+(syntax-comments // forward nil 6 0)
+(syntax-comments // backward t 6 5)
+
+(syntax-comments // forward t 7)
+(syntax-comments // backward t 7)
+(syntax-comments // forward nil 8 0)
+(syntax-comments // backward nil 8 0)
+(syntax-comments // forward t 9)
+(syntax-comments // backward t 9)
+
+(syntax-comments // forward nil 10 0)
+(syntax-comments // backward nil 10 0)
+(syntax-comments // forward t 11)
+(syntax-comments // backward t 11)
+
+(syntax-comments // forward t 13)
+(syntax-comments // backward t 13)
+(syntax-comments // forward t 15)
+(syntax-comments // backward t 15)
+
+;; Emacs 28 "C" style comments inside brace lists.
+(syntax-br-comments // forward t 50)
+(syntax-br-comments // backward t 50)
+(syntax-br-comments // forward t 51)
+(syntax-br-comments // backward t 51)
+(syntax-br-comments // forward t 52)
+(syntax-br-comments // backward t 52)
+
+(syntax-br-comments // forward t 53)
+(syntax-br-comments // backward t 53)
+(syntax-br-comments // forward t 54 58)
+(syntax-br-comments // backward t 54)
+(syntax-br-comments // forward t 55)
+(syntax-br-comments // backward t 55)
+
+(syntax-br-comments // forward t 56 56)
+(syntax-br-comments // backward t 58 54)
+(syntax-br-comments // backward nil 59)
+(syntax-br-comments // forward t 60)
+(syntax-br-comments // backward t 60)
+
+;; Emacs 28 "C" style comments parsed by `parse-partial-sexp'.
+(syntax-pps-comments // 50 70 71)
+(syntax-pps-comments // 52 72 73)
+(syntax-pps-comments // 54 74 55 58)
+(syntax-pps-comments // 56 76 80)
+(syntax-pps-comments // 60 78 79)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Comments containing string delimiters.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(eval-and-compile
+  (setq syntax-comments-section "c-\""))
+
+(syntax-comments /* forward t 120)
+(syntax-comments /* backward t 120)
+(syntax-comments /* forward t 121)
+(syntax-comments /* backward t 121)
+(syntax-comments /* forward t 122)
+(syntax-comments /* backward t 122)
+
+(syntax-comments /* backward nil 123 0)
+(syntax-comments /* forward t 124)
+(syntax-comments /* backward t 124)
+(syntax-comments /* backward nil 125 0)
+(syntax-comments /* forward t 126)
+(syntax-comments /* backward t 126)
+
+(syntax-comments /* forward t 127)
+(syntax-comments /* backward t 127)
+(syntax-comments /* forward t 128)
+(syntax-comments /* backward t 128)
+(syntax-comments /* forward t 129)
+(syntax-comments /* backward t 129)
+
+(syntax-comments /* forward t 130)
+(syntax-comments /* backward t 130)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; The same again, with Emacs 28 style C comments.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(eval-and-compile
+  (setq syntax-comments-section "c++-\""))
+
+(syntax-comments // forward t 120)
+(syntax-comments // backward t 120)
+(syntax-comments // forward t 121)
+(syntax-comments // backward t 121)
+(syntax-comments // forward t 122)
+(syntax-comments // backward t 122)
+
+(syntax-comments // backward nil 123 0)
+(syntax-comments // forward t 124)
+(syntax-comments // backward t 124)
+(syntax-comments // backward nil 125 0)
+(syntax-comments // forward t 126)
+(syntax-comments // backward t 126)
+
+(syntax-comments // forward t 127)
+(syntax-comments // backward t 127)
+(syntax-comments // forward t 128)
+(syntax-comments // backward t 128)
+(syntax-comments // forward t 129)
+(syntax-comments // backward t 129)
+
+(syntax-comments // forward t 130)
+(syntax-comments // backward t 130)
+
 ;;; syntax-tests.el ends here


-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 19 Nov 2020 22:48:01 +0000
Resent-Message-ID: <handler.43558.B43558.16058260759956 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16058260759956
          (code B ref 43558); Thu, 19 Nov 2020 22:48:01 +0000
Received: (at 43558) by debbugs.gnu.org; 19 Nov 2020 22:47:55 +0000
Received: from localhost ([127.0.0.1]:41266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kfsiZ-0002aW-Cx
	for submit <at> debbugs.gnu.org; Thu, 19 Nov 2020 17:47:55 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39920)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kfsiX-0002aJ-EH
 for 43558 <at> debbugs.gnu.org; Thu, 19 Nov 2020 17:47:54 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AE7258025A;
 Thu, 19 Nov 2020 17:47:47 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DC2448005E;
 Thu, 19 Nov 2020 17:47:41 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1605826061;
 bh=vIRgrvRsNOdWfj6o/4o8qJ7XYA6P9pDdWkLVSuS4QBQ=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=V6CiJ1pqPMfzmKUfvU9n11z47cMMZlnkRO/tGayIUCbUG74JxV0RmWvnajRInOfZA
 LDHkSzDxv1GjQN9DPXqhJEPC0SvmRB2aotUs6ejH8CVhpAbEu1UdQLTCNCemC6daXL
 bzBF47Xkne6Clorm37rRWRTv5gyyBSWDZQtwmBJUEZpnTBOAl6v7HtqtJDywdhA78P
 jl8w2ds/R8Fqi96hxHY9Z4ioVKKT+a936yDlI+Kg5JJ1tDGVycJp1Eq90I6i7WJjIy
 pjlCstTNWGfo3tk1RAKM73eh365DjINWOp+ySVuc39qyc77QW76rK+fVDSvOlVCVeX
 fGv7d7iKf6/0g==
Received: from alfajor (unknown [157.52.9.240])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6DE3A1203D8;
 Thu, 19 Nov 2020 17:47:41 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM>
Date: Thu, 19 Nov 2020 17:47:40 -0500
In-Reply-To: <20201119211822.GE6259@ACM> (Alan Mackenzie's message of "Thu, 19
 Nov 2020 21:18:22 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.075 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> So, yeah, you can add yet-another-hack on top of the other syntax.c
>> hacks if you want, but there's a good chance it will only ever be used
>> by CC-mode.  It will take a lot more code changes in syntax.c than
>> a quick tweak to your Elisp code to search for "\*/".
[...]
> OK, here's the patch.

I think the patch agrees with my assessment above (even though it's
still missing a etc/NEWS entry, adjustment to the docstring of
modify-syntax-entry and to the .texi manual).

I really can't understand why you resist so much the use of
a `syntax-table` property on those rare \\\n sequences.


        Stefan


PS: Also, I just noticed that `gcc -Wall` warns about the use of such
multiline comments, so it doesn't seem to be a very popular feature.

PPS: For reference, I just tried to add support for it in sm-c-mode
and this is the resulting code:


@@ -312,7 +315,15 @@ E.g. a #define nested within 2 #ifs will be turned into \"#  define\"."
                                'syntax-table (string-to-syntax "|"))
             (put-text-property (match-beginning 2) (match-end 2)
                                'syntax-table (string-to-syntax "|")))
-          (sm-c--cpp-syntax-propertize end)))))
+          (sm-c--cpp-syntax-propertize end))))
+    ("\\\\\\(\n\\)"
+     (1 (let ((ppss (save-excursion (syntax-ppss (match-beginning 0)))))
+          (when (and (nth 4 ppss)        ;Within a comment
+                     (null (nth 7 ppss)) ;Within a // comment
+                     (save-excursion     ;The \ is not itself escaped
+                       (goto-char (match-beginning 0))
+                       (zerop (mod (skip-chars-backward "\\\\") 2))))
+            (string-to-syntax "."))))))
    (point) end))
 
 (defun sm-c-syntactic-face-function (ppss)





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 13:13:01 +0000
Resent-Message-ID: <handler.43558.B43558.160605076130990 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, acm@HIDDEN
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160605076130990
          (code B ref 43558); Sun, 22 Nov 2020 13:13:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 13:12:41 +0000
Received: from localhost ([127.0.0.1]:47080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgpAX-00083l-0P
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 08:12:41 -0500
Received: from colin.muc.de ([193.149.48.1]:20816 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kgpAV-00083X-Bi
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 08:12:40 -0500
Received: (qmail 98865 invoked by uid 3782); 22 Nov 2020 13:12:32 -0000
Received: from acm.muc.de (p2e5d52bc.dip0.t-ipconnect.de [46.93.82.188]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 22 Nov 2020 14:12:31 +0100
Received: (qmail 10556 invoked by uid 1000); 22 Nov 2020 13:12:31 -0000
Date: Sun, 22 Nov 2020 13:12:31 +0000
Message-ID: <20201122131231.GB5912@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Stefan.

On Thu, Nov 19, 2020 at 17:47:40 -0500, Stefan Monnier wrote:
> >> So, yeah, you can add yet-another-hack on top of the other syntax.c
> >> hacks if you want, but there's a good chance it will only ever be used
> >> by CC-mode.  It will take a lot more code changes in syntax.c than
> >> a quick tweak to your Elisp code to search for "\*/".
> [...]
> > OK, here's the patch.

> I think the patch agrees with my assessment above (even though it's
> still missing a etc/NEWS entry, adjustment to the docstring of
> modify-syntax-entry and to the .texi manual).

Here are these things:



diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index b99b5de0b3..4e9e9207c3 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -287,21 +287,21 @@ Syntax Flags
 @cindex syntax flags
 
   In addition to the classes, entries for characters in a syntax table
-can specify flags.  There are eight possible flags, represented by the
+can specify flags.  There are nine possible flags, represented by the
 characters @samp{1}, @samp{2}, @samp{3}, @samp{4}, @samp{b}, @samp{c},
-@samp{n}, and @samp{p}.
+@samp{e}, @samp{n}, and @samp{p}.
 
   All the flags except @samp{p} are used to describe comment
 delimiters.  The digit flags are used for comment delimiters made up
 of 2 characters.  They indicate that a character can @emph{also} be
 part of a comment sequence, in addition to the syntactic properties
 associated with its character class.  The flags are independent of the
-class and each other for the sake of characters such as @samp{*} in
-C mode, which is a punctuation character, @emph{and} the second
+class and each other for the sake of characters such as @samp{*} in C
+mode, which is a punctuation character, @emph{and} the second
 character of a start-of-comment sequence (@samp{/*}), @emph{and} the
 first character of an end-of-comment sequence (@samp{*/}).  The flags
-@samp{b}, @samp{c}, and @samp{n} are used to qualify the corresponding
-comment delimiter.
+@samp{b}, @samp{c}, @samp{e}, and @samp{n} are used to qualify the
+corresponding comment delimiter.
 
   Here is a table of the possible flags for a character @var{c},
 and what they mean:
@@ -332,6 +332,13 @@ Syntax Flags
 alternative ``c'' comment style.  For a two-character comment
 delimiter, @samp{c} on either character makes it of style ``c''.
 
+@item
+@samp{e} means that when @var{c}, a comment ender or first character
+of a two character ender, is directly proceded by one or more escape
+characters, @var{c} does not act as a comment ender.  Contrast this
+with the effect of variable @code{comment-end-can-be-escaped}
+(@pxref{Control Parsing}).
+
 @item
 @samp{n} on a comment delimiter character specifies that this kind of
 comment can be nested.  Inside such a comment, only comments of the
@@ -357,7 +364,7 @@ Syntax Flags
 @item @samp{*}
 @samp{23b}
 @item newline
-@samp{>}
+@samp{> e}
 @end table
 
 This defines four comment-delimiting sequences:
@@ -377,7 +384,9 @@ Syntax Flags
 
 @item newline
 This is a comment-end sequence for ``a'' style, because the newline
-character does not have the @samp{b} flag.
+character does not have the @samp{b} flag.  It can be escaped by one
+or more @samp{\} characters, so that an ``a'' style comment can
+continue onto the next line.
 @end table
 
 @item
@@ -962,9 +971,14 @@ Control Parsing
 @defvar comment-end-can-be-escaped
 If this buffer local variable is non-@code{nil}, a single character
 which usually terminates a comment doesn't do so when that character
-is escaped.  This is used in C and C++ Modes, where line comments
-starting with @samp{//} can be continued onto the next line by
-escaping the newline with @samp{\}.
+is escaped.  This used to be used in C and C++ Modes, where line
+comments starting with @samp{//} can be continued onto the next line
+by escaping the newline with @samp{\}.
+
+Contrast this variable with the @samp{e} syntax flag (@pxref{Syntax
+Flags}), where two consecutive escape characters escape the comment
+ender.  @code{comment-end-can-be-escaped} should not be used together
+with the @samp{e} syntax flag.
 @end defvar
 
 You can use @code{forward-comment} to move forward or backward over
@@ -1037,6 +1051,8 @@ Syntax Table Internals
 @samp{3} @tab @code{(ash 1 18)} @tab @samp{n} @tab @code{(ash 1 22)}
 @item
 @samp{4} @tab @code{(ash 1 19)} @tab @samp{c} @tab @code{(ash 1 23)}
+@item
+@tab@tab @samp{e} @tab @code{(ash 1 24)}
 @end multitable
 
 @defun string-to-syntax desc
diff --git a/etc/NEWS b/etc/NEWS
index a0e72bc673..3b292e8f41 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1758,6 +1758,12 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
 
 * Lisp Changes in Emacs 28.1
 
++++
+** New syntax flag 'e'.
+This indicates that one or two (or more) escape characters escape a
+comment ender with this flag, causing the comment to be continued past
+that comment ender (typically onto the next line).
+
 +++
 ** 'set-window-configuration' now takes an optional 'dont-set-frame'
 parameter which, when non-nil, instructs the function not to select
diff --git a/src/syntax.c b/src/syntax.c
index df07809aaa..7bdbd114ba 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1224,7 +1270,7 @@ Two-character sequences are represented as described below.
 The second character of NEWENTRY is the matching parenthesis,
  used only if the first character is `(' or `)'.
 Any additional characters are flags.
-Defined flags are the characters 1, 2, 3, 4, b, p, and n.
+Defined flags are the characters 1, 2, 3, 4, b, c, e, n, and p.
  1 means CHAR is the start of a two-char comment start sequence.
  2 means CHAR is the second character of such a sequence.
  3 means CHAR is the start of a two-char comment end sequence.
@@ -1239,6 +1285,11 @@ c (on any of its chars) using this flag:
  c means CHAR is part of comment sequence c.
  n means CHAR is part of a nestable comment sequence.
 
+ e means CHAR, when a comment ender or first char of a two character
+   comment ender, can be escaped by (any number of consecutive)
+   characters with escape syntax.  C and C++ use this facility.
+   Compare and contrast with the variable `comment-end-can-be-escaped'.
+
  p means CHAR is a prefix character for `backward-prefix-chars';
    such characters are treated as whitespace when they occur
    between expressions.



> I really can't understand why you resist so much the use of
> a `syntax-table` property on those rare \\\n sequences.

Because syntax-table text properties are already used for so many
different things in CC Mode (I think the count is five in C++ Mode).
Adding another one would mean having to scan for this rare construct at
every buffer change, and this would slow things down, possibly a lot.

There is no slowdown (beyond a possible microscopic one) in the
modification to syntax.c and, as a bonus, I have written around 200 test
cases for syntax.c's comment features.

>         Stefan


> PS: Also, I just noticed that `gcc -Wall` warns about the use of such
> multiline comments, so it doesn't seem to be a very popular feature.

It is more of a mistake that people occasionally might make than a
feature.  In my opinion, having escaped newlines inside line comments is
a bug in the C/C++ language standards.  Anybody might "end" a line
comment accidentally with "\" or "\\".

> PPS: For reference, I just tried to add support for it in sm-c-mode
> and this is the resulting code:

Just to emphasize Stefan Kangas's point, it is a newline preceded by a
"\" which continues the comment, not an escaped NL in the ordinary
sense.  In particular two "\"s followed by NL still continue the
comment.

> @@ -312,7 +315,15 @@ E.g. a #define nested within 2 #ifs will be turned into \"#  define\"."
>                                 'syntax-table (string-to-syntax "|"))
>              (put-text-property (match-beginning 2) (match-end 2)
>                                 'syntax-table (string-to-syntax "|")))
> -          (sm-c--cpp-syntax-propertize end)))))
> +          (sm-c--cpp-syntax-propertize end))))
> +    ("\\\\\\(\n\\)"
> +     (1 (let ((ppss (save-excursion (syntax-ppss (match-beginning 0)))))
> +          (when (and (nth 4 ppss)        ;Within a comment
> +                     (null (nth 7 ppss)) ;Within a // comment
> +                     (save-excursion     ;The \ is not itself escaped
> +                       (goto-char (match-beginning 0))
> +                       (zerop (mod (skip-chars-backward "\\\\") 2))))
> +            (string-to-syntax "."))))))
>     (point) end))
>  
>  (defun sm-c-syntactic-face-function (ppss)

Yes, something like this would be possible.  But all these syntax-ppsss
would be slow, at least somewhat, as discussed above.

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 15:21:02 +0000
Resent-Message-ID: <handler.43558.B43558.160605844219446 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160605844219446
          (code B ref 43558); Sun, 22 Nov 2020 15:21:02 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 15:20:42 +0000
Received: from localhost ([127.0.0.1]:48064 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgrAP-00053Z-Tt
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 10:20:42 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:30810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kgrAO-00053F-CR
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 10:20:40 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DBCD38081D;
 Sun, 22 Nov 2020 10:20:34 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 69D7F80241;
 Sun, 22 Nov 2020 10:20:33 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1606058433;
 bh=zzVzfaR6IviLBfygzwIc/iFuhYfchxKLM+An0Ngm0fM=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=gZZgk8Xjkkl/HNNmQLAvwbTGlAXfRy0SA3dHFyxiT0SCH3SYZvZZuqWOdPPpO0wI1
 26T7eOMasKuhsGt3S1NSqYHHLJsKiieWzj7XthgzjkI0hjKgfOB6lrjMCqjOxEVYGZ
 bAF2nVlnqKMR2hEKo9fj0o73eiXzDBahbZw3QQ5a1Q//wAML54kBYtj/WO49Mn1XMY
 70zQg7nqI6JtaYJFhLt+GVkGx8EJXa+QbL4CU2H5kdYvgEfY9u1+ZEZtHZ4vzQpgqU
 WiB14RfqjsOA969D+wKdmjmd0dST0ynJE8Xx3TSGyRm//Vyis37AhxqH+mZRSBE/pg
 HrA/iR0HGxLPg==
Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 304C712044C;
 Sun, 22 Nov 2020 10:20:33 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM>
Date: Sun, 22 Nov 2020 10:20:32 -0500
In-Reply-To: <20201122131231.GB5912@ACM> (Alan Mackenzie's message of "Sun, 22
 Nov 2020 13:12:31 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.013 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Because syntax-table text properties are already used for so many
> different things in CC Mode (I think the count is five in C++ Mode).
> Adding another one would mean having to scan for this rare construct at
> every buffer change, and this would slow things down, possibly a lot.

The fact that you already have 5 other such uses implies that the slow
down from this one cannot possibly be larger than 20% (since the scan
for it is very simple, I doubt any of the other 5 is simpler).

Most major modes have such things and we live just fine with them.
This is a non-issue.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 15:36:01 +0000
Resent-Message-ID: <handler.43558.B43558.160605934421085 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, mattiase@HIDDEN, monnier@HIDDEN
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160605934421085
          (code B ref 43558); Sun, 22 Nov 2020 15:36:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 15:35:44 +0000
Received: from localhost ([127.0.0.1]:48087 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgrOy-0005U1-25
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 10:35:44 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1kgrOw-0005To-Gw
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 10:35:43 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45709)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1kgrOm-00031J-4F; Sun, 22 Nov 2020 10:35:35 -0500
Received: from [176.228.60.248] (port=1213 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1kgrOl-0007ap-C3; Sun, 22 Nov 2020 10:35:31 -0500
Date: Sun, 22 Nov 2020 17:35:24 +0200
Message-Id: <83a6v9xv43.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <20201122131231.GB5912@ACM> (message from Alan Mackenzie on Sun, 
 22 Nov 2020 13:12:31 +0000)
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 22 Nov 2020 13:12:31 +0000
> From: Alan Mackenzie <acm@HIDDEN>
> Cc: 43558 <at> debbugs.gnu.org,
>  Mattias Engdegård <mattiase@HIDDEN>, acm@HIDDEN
> 
> +@samp{e} means that when @var{c}, a comment ender or first character
> +of a two character ender, is directly proceded by one or more escape
                                         ^^^^^^^^
"preceded", I guess?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 17:04:02 +0000
Resent-Message-ID: <handler.43558.B43558.16060646205572 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, mattiase@HIDDEN, monnier@HIDDEN
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16060646205572
          (code B ref 43558); Sun, 22 Nov 2020 17:04:02 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 17:03:40 +0000
Received: from localhost ([127.0.0.1]:48184 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgsm3-0001Ro-SU
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 12:03:40 -0500
Received: from colin.muc.de ([193.149.48.1]:30218 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kgsly-0001RS-Ka
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 12:03:38 -0500
Received: (qmail 26085 invoked by uid 3782); 22 Nov 2020 17:03:27 -0000
Received: from acm.muc.de (p2e5d52bc.dip0.t-ipconnect.de [46.93.82.188]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 22 Nov 2020 18:03:27 +0100
Received: (qmail 11787 invoked by uid 1000); 22 Nov 2020 17:03:27 -0000
Date: Sun, 22 Nov 2020 17:03:27 +0000
Message-ID: <20201122170327.GC5912@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <83a6v9xv43.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <83a6v9xv43.fsf@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Eli.

On Sun, Nov 22, 2020 at 17:35:24 +0200, Eli Zaretskii wrote:
> > Date: Sun, 22 Nov 2020 13:12:31 +0000
> > From: Alan Mackenzie <acm@HIDDEN>
> > Cc: 43558 <at> debbugs.gnu.org,
> >  Mattias Engdegård <mattiase@HIDDEN>, acm@HIDDEN

> > +@samp{e} means that when @var{c}, a comment ender or first character
> > +of a two character ender, is directly proceded by one or more escape
>                                          ^^^^^^^^
> "preceded", I guess?

Er, yes.  Thanks!  I've corrected it.

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 17:09:01 +0000
Resent-Message-ID: <handler.43558.B43558.16060649206066 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16060649206066
          (code B ref 43558); Sun, 22 Nov 2020 17:09:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 17:08:40 +0000
Received: from localhost ([127.0.0.1]:48188 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgsqu-0001Zm-ET
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 12:08:40 -0500
Received: from colin.muc.de ([193.149.48.1]:30423 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kgsqr-0001ZT-BV
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 12:08:38 -0500
Received: (qmail 28824 invoked by uid 3782); 22 Nov 2020 17:08:30 -0000
Received: from acm.muc.de (p2e5d52bc.dip0.t-ipconnect.de [46.93.82.188]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 22 Nov 2020 18:08:30 +0100
Received: (qmail 11810 invoked by uid 1000); 22 Nov 2020 17:08:30 -0000
Date: Sun, 22 Nov 2020 17:08:30 +0000
Message-ID: <20201122170830.GD5912@ACM>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Stefan.

On Sun, Nov 22, 2020 at 10:20:32 -0500, Stefan Monnier wrote:
> > Because syntax-table text properties are already used for so many
> > different things in CC Mode (I think the count is five in C++ Mode).
> > Adding another one would mean having to scan for this rare construct at
> > every buffer change, and this would slow things down, possibly a lot.

> The fact that you already have 5 other such uses implies that the slow
> down from this one cannot possibly be larger than 20% (since the scan
> for it is very simple, I doubt any of the other 5 is simpler).

The fact remains that an implementation at the C level is objectively
better than one at the Lisp level.

> Most major modes have such things and we live just fine with them.
> This is a non-issue.

Really?  Are there any other programming language modes whose comments
syntax.c cannot handle without syntax-table text properties?

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 17:47:02 +0000
Resent-Message-ID: <handler.43558.B43558.16060671979879 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16060671979879
          (code B ref 43558); Sun, 22 Nov 2020 17:47:02 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 17:46:37 +0000
Received: from localhost ([127.0.0.1]:48204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgtRc-0002ZH-W3
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 12:46:37 -0500
Received: from mail-wr1-f49.google.com ([209.85.221.49]:38831)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kgtRY-0002Z2-RC
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 12:46:35 -0500
Received: by mail-wr1-f49.google.com with SMTP id p8so16236339wrx.5
 for <43558 <at> debbugs.gnu.org>; Sun, 22 Nov 2020 09:46:32 -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=gWA9ykFE7ZHri603WpSQgz93pv/h/4h3xLOygZ6qJ50=;
 b=dKWmV0Jjn7I0OYhxSvMJOkqIJcGh0Z7bwwLEry1prferOoUOq/PGUkkQtYDBK0qw/I
 HUvYvtjfsVnd5L2TjVbr+8c62PiqNgEj4z9hWX2BVu/YqgZ3aZKm4jKx6SefggWfw8+u
 YfpMMfqr9Mu5ublOeb4t52ItNN8K4TigdePRfmYL2B2XolfezBaB5iXq1iY3PYqU1+GC
 25GpWgUeUeWHS97dK5UsAJEuuz6rrbRkVNP3e5uFY9XhyXZgO1EPTRKjBOtQVAhyuWle
 +MtowK9Ud5eW6yebSIBc/FAZBMnooQ+4W6bdNZcUxYtNZ9F9iNFvfDTG/dwdH/W+rXNl
 Hejg==
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=gWA9ykFE7ZHri603WpSQgz93pv/h/4h3xLOygZ6qJ50=;
 b=ZL/DjJpRNFaXernGXvMVEt/NeIFWsGzZMl+beWX4yEW4zLARh6ZEAYA7AbysirBhkc
 7zCQ2lYH+Y4o67/jSuPDGBw6LAeQOIfCARogosDVKgr7MtJWSTSXyehS/7qUBxg5e/fr
 qoXN38INjQN2H47esZ2mvQ8JT65tm5WXG0HbikC9Yf12SVSuTJPlQbJ1NvRBuDry6GEI
 mJWH+TSbF8V0rt7fG5apX5h6a+3hdY8JHCX/v26V8+9QI2vHQCiCb4jgKRekD24RgTyx
 7lm10TiSPK3qK/cY2nbCAD79SMszKCtKzvbYW7FCVdpy2NAbgoXWT3Y/msAidGYf8pu+
 IBTA==
X-Gm-Message-State: AOAM533uCsWReq/0AdrUvLPJV+gH1WfIeBacUC4NYDQvapCONIG3fnUw
 m79QyP7qDANH1m1mAPvnwiQ=
X-Google-Smtp-Source: ABdhPJyqIF0JihQqFRE0zjl/gLx0eXi7STI/QqwJcpvLneHrw87Hng7jwXTq13Dub+5pPpYDNFnTyg==
X-Received: by 2002:adf:9b98:: with SMTP id d24mr26399567wrc.17.1606067186964; 
 Sun, 22 Nov 2020 09:46:26 -0800 (PST)
Received: from [192.168.0.4] ([66.205.71.3])
 by smtp.googlemail.com with ESMTPSA id d3sm13521170wre.91.2020.11.22.09.46.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 22 Nov 2020 09:46:26 -0800 (PST)
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
 <20201122170830.GD5912@ACM>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
Date: Sun, 22 Nov 2020 19:46:24 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <20201122170830.GD5912@ACM>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 22.11.2020 19:08, Alan Mackenzie wrote:
> Really?  Are there any other programming language modes whose comments
> syntax.c cannot handle without syntax-table text properties?

Ruby is just one example.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 18:21:01 +0000
Resent-Message-ID: <handler.43558.B43558.160606920713162 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160606920713162
          (code B ref 43558); Sun, 22 Nov 2020 18:21:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 18:20:07 +0000
Received: from localhost ([127.0.0.1]:48249 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgty2-0003QE-Ou
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 13:20:06 -0500
Received: from colin.muc.de ([193.149.48.1]:33315 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kgty0-0003PS-OY
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 13:20:06 -0500
Received: (qmail 67563 invoked by uid 3782); 22 Nov 2020 18:19:58 -0000
Received: from acm.muc.de (p2e5d52bc.dip0.t-ipconnect.de [46.93.82.188]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 22 Nov 2020 19:19:57 +0100
Received: (qmail 12373 invoked by uid 1000); 22 Nov 2020 18:19:57 -0000
Date: Sun, 22 Nov 2020 18:19:57 +0000
Message-ID: <20201122181957.GF5912@ACM>
References: <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
 <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Dmitry.

On Sun, Nov 22, 2020 at 19:46:24 +0200, Dmitry Gutov wrote:
> On 22.11.2020 19:08, Alan Mackenzie wrote:
> > Really?  Are there any other programming language modes whose comments
> > syntax.c cannot handle without syntax-table text properties?

> Ruby is just one example.

Thanks.

I've just searched the web for that.  Ruby has block comment delimiters
=begin and =end.

It would be possible to handle these in syntax.c, but somewhat clumsy
and awkward.

Presumably ruby-mode handles these with syntax-table text properties
applied to the = sign and the terminating d, which is a little clumsy,
but not too bad, at the Lisp level.

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 20:40:01 +0000
Resent-Message-ID: <handler.43558.B43558.160607756026440 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160607756026440
          (code B ref 43558); Sun, 22 Nov 2020 20:40:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 20:39:20 +0000
Received: from localhost ([127.0.0.1]:48407 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgw8l-0006sN-Nm
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 15:39:19 -0500
Received: from mail-wm1-f42.google.com ([209.85.128.42]:51434)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kgw8j-0006s9-Gg
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 15:39:18 -0500
Received: by mail-wm1-f42.google.com with SMTP id a186so13297760wme.1
 for <43558 <at> debbugs.gnu.org>; Sun, 22 Nov 2020 12:39:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:from:subject:to:cc:references:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=we0OKaJpFtvrHjCMuQ65e8O/kze9zH4xzTXK8b23pHc=;
 b=PGL3GYyFx1g6FIUO02XERuAiQMW1iZMlPqSpiMVHOawiW0mWHE5yyyfDTHCaR8jePr
 40ZHAIKyURk5Kh9+kxkHef+XX9aUDYx4/jb7jCaBtcxkth5ehBOWvHmn+CKK6hWoHHiD
 gVwK+tzL54XdIMRKnlpwEKodmqzFIGbKS5j+7ZuumUUat0txj50KQJ3s8mTOpkho10j/
 N+PAdTI2tv6W4DMvoeuFzgypb23qieuqKZuaTeSC12jix0jk3adESICGmegVLnAQglaU
 89olzuP0p3LfsSjF4wUYb8Pin5KH3pwPAlSPbtmgls/idLC4hCWe6178rc17cOJwqDG9
 6tIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:from:subject:to:cc:references:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=we0OKaJpFtvrHjCMuQ65e8O/kze9zH4xzTXK8b23pHc=;
 b=HCuyzhBjFUyqxTR9cukIKuP+1SS/0WQDa+t/K0moxBiIqDOEF48UddSmDEArAy8laC
 YS1Z6e1FofDIRDDxPDXkeBsVx9sbISGCYjt6um0txjEZN55IUnZ4tQzG44H/5dy/LtbK
 Dqq5d8SSMTUZgMfh8Z/gas8Bfawc0QkF7OhzBeYQIRmJNq2QmocV2Ilog3oEUoGeAEjx
 FGwz2INkKMapcIdb5RKrbf3gwkFXl7ghHgqztZYaV6cKf8rVfPQDhjplYdVpq5fvdoQn
 Hkot3nCv9lk9bPvYsAVSjgwU9M7VAMLVbTJByuAcyCSv4di/2AyGgNRltmiPlSPKqlgS
 d2hA==
X-Gm-Message-State: AOAM531vnML/QTE2cL3MTifQBsAKI668ikdsC1XrwZFo//kf2599Rxys
 lvORT6MYAfCG8PyDLfp9Iz4=
X-Google-Smtp-Source: ABdhPJyWxieBuTB4IpZxaUq54/s1BEvlB4KxnARAv3KS0oSuyXSpO986ItjmDjn7JNg9Dt7IWOFkSg==
X-Received: by 2002:a7b:c841:: with SMTP id c1mr19940427wml.31.1606077551623; 
 Sun, 22 Nov 2020 12:39:11 -0800 (PST)
Received: from [192.168.0.4] ([66.205.71.3])
 by smtp.googlemail.com with ESMTPSA id d128sm13173574wmc.7.2020.11.22.12.39.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 22 Nov 2020 12:39:10 -0800 (PST)
From: Dmitry Gutov <dgutov@HIDDEN>
References: <20200923144824.GD6178@ACM>
 <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN> <20200924102022.GA4714@ACM>
 <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN> <20201119211822.GE6259@ACM>
 <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN> <20201122131231.GB5912@ACM>
 <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN> <20201122181957.GF5912@ACM>
Message-ID: <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
Date: Sun, 22 Nov 2020 22:39:08 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <20201122181957.GF5912@ACM>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On 22.11.2020 20:19, Alan Mackenzie wrote:
> Hello, Dmitry.
> 
> On Sun, Nov 22, 2020 at 19:46:24 +0200, Dmitry Gutov wrote:
>> On 22.11.2020 19:08, Alan Mackenzie wrote:
>>> Really?  Are there any other programming language modes whose comments
>>> syntax.c cannot handle without syntax-table text properties?
> 
>> Ruby is just one example.
> 
> Thanks.
> 
> I've just searched the web for that.  Ruby has block comment delimiters
> =begin and =end.
> 
> It would be possible to handle these in syntax.c, but somewhat clumsy
> and awkward.

Just like the C comments syntax discussed here.

> Presumably ruby-mode handles these with syntax-table text properties
> applied to the = sign and the terminating d, which is a little clumsy,
> but not too bad, at the Lisp level.

This is just two more regexps to search for (and propertize). I don't 
expect that the slowdown from them is in any way perceptible.

And the general point is that the Emacs syntax table structure doesn't 
necessarily have to mirror the syntax of the C language.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 21:15:01 +0000
Resent-Message-ID: <handler.43558.B43558.160607964529627 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160607964529627
          (code B ref 43558); Sun, 22 Nov 2020 21:15:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 21:14:05 +0000
Received: from localhost ([127.0.0.1]:48433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgwgP-0007hn-J4
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 16:14:05 -0500
Received: from colin.muc.de ([193.149.48.1]:40708 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kgwgK-0007h5-TE
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 16:14:04 -0500
Received: (qmail 62978 invoked by uid 3782); 22 Nov 2020 21:13:54 -0000
Received: from acm.muc.de (p2e5d52bc.dip0.t-ipconnect.de [46.93.82.188]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 22 Nov 2020 22:13:53 +0100
Received: (qmail 13032 invoked by uid 1000); 22 Nov 2020 21:13:53 -0000
Date: Sun, 22 Nov 2020 21:13:53 +0000
Message-ID: <20201122211353.GH5912@ACM>
References: <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
 <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Dmitry.

On Sun, Nov 22, 2020 at 22:39:08 +0200, Dmitry Gutov wrote:
> On 22.11.2020 20:19, Alan Mackenzie wrote:
> > On Sun, Nov 22, 2020 at 19:46:24 +0200, Dmitry Gutov wrote:
> >> On 22.11.2020 19:08, Alan Mackenzie wrote:
> >>> Really?  Are there any other programming language modes whose comments
> >>> syntax.c cannot handle without syntax-table text properties?

> >> Ruby is just one example.

> > Thanks.

> > I've just searched the web for that.  Ruby has block comment delimiters
> > =begin and =end.

> > It would be possible to handle these in syntax.c, but somewhat clumsy
> > and awkward.

> Just like the C comments syntax discussed here.

Not at all.  The amendment we're talking about is to handle escaped
newlines inside line comments.  Which takes precedence, the comment to
EOL, or the escape?  It's rather arbitrary, and should be configurable.

Coding up the Ruby block comments in syntax.c would involve string
comparisons, for example, and would be an entirely new flavour inside
that file.  It would involve examining individual letters rather than
just their syntax.

By contrast, coding up the escaped NL in syntax.c was straightforward and
natural.

Have you looked at the patch?

> > Presumably ruby-mode handles these with syntax-table text properties
> > applied to the = sign and the terminating d, which is a little clumsy,
> > but not too bad, at the Lisp level.

> This is just two more regexps to search for (and propertize). I don't 
> expect that the slowdown from them is in any way perceptible.

> And the general point is that the Emacs syntax table structure doesn't 
> necessarily have to mirror the syntax of the C language.

Maybe not, but the point remains, that for this fix, a fix at the C level
is objectively better than a fix at the Lisp level.  Furthermore, the C
level change is already implemented and has been well tested.

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 21:35:02 +0000
Resent-Message-ID: <handler.43558.B43558.160608086832395 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160608086832395
          (code B ref 43558); Sun, 22 Nov 2020 21:35:02 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 21:34:28 +0000
Received: from localhost ([127.0.0.1]:48451 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgx08-0008QR-Hj
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 16:34:28 -0500
Received: from mail-wr1-f53.google.com ([209.85.221.53]:33416)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kgx06-0008QE-KK
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 16:34:27 -0500
Received: by mail-wr1-f53.google.com with SMTP id u12so16753252wrt.0
 for <43558 <at> debbugs.gnu.org>; Sun, 22 Nov 2020 13:34:26 -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=tf+9oNtewtx/+lYIaYbUJ6/iZjePgKkjZD+iiqNCwJE=;
 b=OagKYC/9Fl+cnZgVamPqQp3dSSYOVPFXOAQvrdKO2hIx8aREXl4m2Tl8tovas6Wx+i
 wCXpZu4knowryR5mqf65GhmSr7pjq+9M1zV1SUAXPfbUmtjPUfcOfkHOTSJLFaJQ+6ZL
 odReZc4YzPLwayY965JeRvADq/mjzhVj+7hVhA8WEKAbWu94/4r9TTnCnJ9UIEpOP+CM
 e1XGt8reaT/RV6wF98vb5NE61qQvlLGU7z+LWnRVt/pSoo3CKcGv5lJ86Xmc3CFzW92w
 NLyV/NYVcPPsEmiE2urCHJlAUZKFdc9PkRRe1fl6XChXvpUvGzCsJ4GdNFpPD4DPGRiW
 j3vA==
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=tf+9oNtewtx/+lYIaYbUJ6/iZjePgKkjZD+iiqNCwJE=;
 b=oENin2USK/kQdvAKSWWFEb0kC0s6XZoblQoJrptpx0vHitpB9J1DGszat3HGzikm5Z
 Ss3TeGifwy9oOs+YxgrpnAV9lhdHa63Yv69gLGA/wR0iZv6olI3cBP4Z6MxmVfhwD5W2
 k22x6ik20VpfD3RQHTWdLAepyRLXhs3n9skXu83YM7FRqVcoyTWmkj7GDbsQluh2gC5p
 BdJMc3JTKqeAsKepfitS3L/iuDSrEfsVEg/A4Oc4/QWdDlMcPigAz2yTmpLAV69R+3YK
 s+BaFjUF2Rt5qwa2Z5isPglLFE+53iqYCLh7C+ym0XeEjuLsWWaBRgqbGqR9C1TusI94
 AzKw==
X-Gm-Message-State: AOAM532PLBlZAokiT1uS7va60l+JYLxs4BPSBY8e9sigU22zqB/W7SvM
 METb1eAljvEhZOhXUKaqN6Y=
X-Google-Smtp-Source: ABdhPJwVtePl3N5DChTD3utR6Y69qUiEH0ysFzt8NXxc0JcJu4zLNdlrso/HMrxJz6sV7s6uKD8l3A==
X-Received: by 2002:adf:eacb:: with SMTP id o11mr27907412wrn.208.1606080860668; 
 Sun, 22 Nov 2020 13:34:20 -0800 (PST)
Received: from [192.168.0.4] ([66.205.71.3])
 by smtp.googlemail.com with ESMTPSA id m3sm16210739wrv.6.2020.11.22.13.34.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 22 Nov 2020 13:34:19 -0800 (PST)
References: <20200924102022.GA4714@ACM>
 <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN> <20201119211822.GE6259@ACM>
 <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN> <20201122131231.GB5912@ACM>
 <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN> <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN> <20201122211353.GH5912@ACM>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
Date: Sun, 22 Nov 2020 23:34:18 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <20201122211353.GH5912@ACM>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.5 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Hi Alan,

On 22.11.2020 23:13, Alan Mackenzie wrote:

> Coding up the Ruby block comments in syntax.c would involve string
> comparisons, for example, and would be an entirely new flavour inside
> that file.  It would involve examining individual letters rather than
> just their syntax.

It could be made to support a new syntax using a finite state machine, 
something like that. And the strings could be converted to such by the 
major mode. But you're right, it would be more difficult.

> By contrast, coding up the escaped NL in syntax.c was straightforward and
> natural.
> 
> Have you looked at the patch?

Yup.

It's not terrible, but it's still a bunch of new if/elses that one would 
need to grasp to maintain that code.

>>> Presumably ruby-mode handles these with syntax-table text properties
>>> applied to the = sign and the terminating d, which is a little clumsy,
>>> but not too bad, at the Lisp level.
> 
>> This is just two more regexps to search for (and propertize). I don't
>> expect that the slowdown from them is in any way perceptible.
> 
>> And the general point is that the Emacs syntax table structure doesn't
>> necessarily have to mirror the syntax of the C language.
> 
> Maybe not, but the point remains, that for this fix, a fix at the C level
> is objectively better than a fix at the Lisp level.  Furthermore, the C
> level change is already implemented and has been well tested.

Why is it objectively better?

With user experience (speed, latencies, etc) being equal or within the 
margin of error, I think it's more logical to go with simpler data 
structures and low level APIs.

Finally, as I recall you feel strongly about supporting older Emacs 
versions, a significant number of them. Doing that fix in Lisp would 
allow you to fix the bug for those versions too. Not just Emacs 28+.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 22:02:02 +0000
Resent-Message-ID: <handler.43558.B43558.16060824812441 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.16060824812441
          (code B ref 43558); Sun, 22 Nov 2020 22:02:02 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 22:01:21 +0000
Received: from localhost ([127.0.0.1]:48465 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgxQ9-0000dJ-Dg
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 17:01:21 -0500
Received: from colin.muc.de ([193.149.48.1]:42684 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1kgxQ5-0000d3-KK
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 17:01:19 -0500
Received: (qmail 89144 invoked by uid 3782); 22 Nov 2020 22:01:11 -0000
Received: from acm.muc.de (p2e5d52bc.dip0.t-ipconnect.de [46.93.82.188]) by
 localhost.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 22 Nov 2020 23:01:10 +0100
Received: (qmail 13230 invoked by uid 1000); 22 Nov 2020 22:01:10 -0000
Date: Sun, 22 Nov 2020 22:01:10 +0000
Message-ID: <20201122220110.GI5912@ACM>
References: <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
 <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
 <20201122211353.GH5912@ACM>
 <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Dmitry.

On Sun, Nov 22, 2020 at 23:34:18 +0200, Dmitry Gutov wrote:
> Hi Alan,

> On 22.11.2020 23:13, Alan Mackenzie wrote:

> > Coding up the Ruby block comments in syntax.c would involve string
> > comparisons, for example, and would be an entirely new flavour
> > inside that file.  It would involve examining individual letters
> > rather than just their syntax.

> It could be made to support a new syntax using a finite state machine,
> something like that. And the strings could be converted to such by the
> major mode. But you're right, it would be more difficult.

> > By contrast, coding up the escaped NL in syntax.c was
> > straightforward and natural.

> > Have you looked at the patch?

> Yup.

> It's not terrible, but it's still a bunch of new if/elses that one
> would need to grasp to maintain that code.

It's character, the general use of ifs/elses, and so on, is unchanged.
Only somebody with a very detailed memory of exact statements would be
inconvenienced, and that only slightly.

> >>> Presumably ruby-mode handles these with syntax-table text
> >>> properties applied to the = sign and the terminating d, which is a
> >>> little clumsy, but not too bad, at the Lisp level.

> >> This is just two more regexps to search for (and propertize). I
> >> don't expect that the slowdown from them is in any way perceptible.

> >> And the general point is that the Emacs syntax table structure
> >> doesn't necessarily have to mirror the syntax of the C language.

> > Maybe not, but the point remains, that for this fix, a fix at the C
> > level is objectively better than a fix at the Lisp level.
> > Furthermore, the C level change is already implemented and has been
> > well tested.

> Why is it objectively better?

It's faster, and it avoids fragmenting the handling of CC Mode comments
between C and Lisp the way that of strings, for example, has been.  It
provides a mechanism which might be useful to other major modes in the
future.

> With user experience (speed, latencies, etc) being equal or within the 
> margin of error, I think it's more logical to go with simpler data 
> structures and low level APIs.

Fixing things in syntax.c was simpler than a Lisp solution using
syntax-table text properties would have been.

> Finally, as I recall you feel strongly about supporting older Emacs 
> versions, a significant number of them. Doing that fix in Lisp would 
> allow you to fix the bug for those versions too. Not just Emacs 28+.

Yes.  That appears to be the sole drawback of the fix being in syntax.c.

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 23:01:01 +0000
Resent-Message-ID: <handler.43558.B43558.160608605215922 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160608605215922
          (code B ref 43558); Sun, 22 Nov 2020 23:01:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 23:00:52 +0000
Received: from localhost ([127.0.0.1]:48505 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgyLj-00048k-OP
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 18:00:51 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19317)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kgyLh-00048X-6e
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 18:00:50 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7ADA6440649;
 Sun, 22 Nov 2020 18:00:43 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id EAB59440490;
 Sun, 22 Nov 2020 18:00:41 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1606086041;
 bh=ZRvD0cyPvaCSD681PKOywyNOvbGYErNLVkcBMtNux9E=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=TZu+5VxcJgb5Lsti4tEe3JLL07Qvv+VofGbMf8t8Pa2WZ3t2XcAWbNsWVk0pRYJBE
 4jd3gQhVRxQrLU8ZwtfaHc31M6vdpRvj3bNC5PmqV+AlZEQp9iM3xO+sTejl0Q65xD
 tWE9viSGfV/pzQaBnb7u9XRGxj8CelJDpuT/ujqgOyrGpgjgRRD6OrCtv37Fahji46
 jHqIwpc0pqf6zJIHXFGIq9/0OoMYDTvbcCKsKgr+LOFy25v8/u3WkVF6oIXIHKvnGn
 a6XFJs9pjLOCQh4VZ12AfrGlym1mhztKMI1C0dUUXBDCGKLIMpwDk1cuWmCO080qBH
 Ybx/VtIpsJ0NA==
Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A66EA1203BC;
 Sun, 22 Nov 2020 18:00:41 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvk0udnh2c.fsf-monnier+emacs@HIDDEN>
References: <20201119211822.GE6259@ACM>
 <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN> <20201122131231.GB5912@ACM>
 <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
 <20201122211353.GH5912@ACM>
 <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
 <20201122220110.GI5912@ACM>
Date: Sun, 22 Nov 2020 18:00:40 -0500
In-Reply-To: <20201122220110.GI5912@ACM> (Alan Mackenzie's message of "Sun, 22
 Nov 2020 22:01:10 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.072 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> It provides a mechanism which might be useful to other major modes in
> the future.

FWIW, I doubt it.
In my experience these details never quite match.

>> With user experience (speed, latencies, etc) being equal or within the 
>> margin of error, I think it's more logical to go with simpler data 
>> structures and low level APIs.
> Fixing things in syntax.c was simpler than a Lisp solution using
> syntax-table text properties would have been.

I find it hard to take this statement seriously after having seen my
sm-c-mode patch.

>> Finally, as I recall you feel strongly about supporting older Emacs
>> versions, a significant number of them. Doing that fix in Lisp would
>> allow you to fix the bug for those versions too. Not just Emacs 28+.
> Yes.  That appears to be the sole drawback of the fix being in syntax.c.

I don't really find this to be a drawback since I don't care about
CC-mode's support for multiline `//` comments in older Emacsen.

But the added complexity in the C code and in the API documentation for the
sole benefit of C (and C++?) mode is a drawback, yes.

I do want to clarify my position, tho: while I don't like your patch
very much because I think a Lisp-level solution (like the one I used in
sm-c-mode) is preferable I find your patch acceptable.


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Stefan Monnier <monnier@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 22 Nov 2020 23:11:01 +0000
Resent-Message-ID: <handler.43558.B43558.160608662216758 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.160608662216758
          (code B ref 43558); Sun, 22 Nov 2020 23:11:01 +0000
Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 23:10:22 +0000
Received: from localhost ([127.0.0.1]:48511 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kgyUp-0004M6-LF
	for submit <at> debbugs.gnu.org; Sun, 22 Nov 2020 18:10:21 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18147)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1kgyUn-0004Lr-Lr
 for 43558 <at> debbugs.gnu.org; Sun, 22 Nov 2020 18:10:13 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6958E80DFB;
 Sun, 22 Nov 2020 18:10:08 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F132E806A5;
 Sun, 22 Nov 2020 18:10:06 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1606086606;
 bh=qQagWx9/AfamWuep69H9GumZZk4PHaQsIPw5nfzV8Gw=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=TWYy5X4Aawfs5c2/DT//tWAsR3dez6oNLMV0vpiGK8RY/E288nYFyd6fH2QImUyBt
 f7/Bgi1cipClB8Ey6c45zzCnGcHhGigrhIECKNy+CFM2N44ClWC28YkP5SQ5DdtaqW
 LmhUDFXgF3zwgK6JsR/bYADUvdw0g1z0C8Lohv7u7UGY/chX02SVHuB4kYIJKp66UT
 rLJTIZVMX+ckFCvD232n5M1lPY6hao8IH5jDasZop0P9ee7qltX5kNOzZSaRBnF8nw
 eYA3NYXrQPo61w6mtqjOynvZfiJwv0pGSyvcSDs7uOmO9aLyoJ1+l/qkGEIOOrriGE
 gZfuaLPjXNr+A==
Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BA23B12037C;
 Sun, 22 Nov 2020 18:10:06 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
Message-ID: <jwvd005ngfz.fsf-monnier+emacs@HIDDEN>
References: <DEA1EEC4-B259-48C2-B00B-30CB8799A0DB@HIDDEN>
 <20200923144824.GD6178@ACM> <jwva6xgtjzd.fsf-monnier+emacs@HIDDEN>
 <20200924102022.GA4714@ACM> <jwv7dsjp1i7.fsf-monnier+emacs@HIDDEN>
 <20201119211822.GE6259@ACM> <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN>
 <20201122131231.GB5912@ACM> <jwv8sats9mc.fsf-monnier+emacs@HIDDEN>
 <20201122170830.GD5912@ACM>
Date: Sun, 22 Nov 2020 18:10:05 -0500
In-Reply-To: <20201122170830.GD5912@ACM> (Alan Mackenzie's message of "Sun, 22
 Nov 2020 17:08:30 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.037 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Really?  Are there any other programming language modes whose comments
> syntax.c cannot handle without syntax-table text properties?

Yes, a fair number.  Beside the ones that use "long" delimiters, there
are some that put restrictions about where a comment can start (e.g. the
# in `sh` is a normal character when it appears within a word), there's
Scheme's #;(...) "sexp comment" (which we still don't actually handle
correctly), there are cases where there are too many different syntaxes
(e.g. in Pascal you can have (*...*), /*...*/, //...\n and then Emacs
concludes that `(/` is also a valid comment starter), ...


        Stefan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 13 May 2021 10:39:02 +0000
Resent-Message-ID: <handler.43558.B43558.162090229417206 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Monnier <monnier@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Alan Mackenzie <acm@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.162090229417206
          (code B ref 43558); Thu, 13 May 2021 10:39:02 +0000
Received: (at 43558) by debbugs.gnu.org; 13 May 2021 10:38:14 +0000
Received: from localhost ([127.0.0.1]:41433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lh8jO-0004TS-KV
	for submit <at> debbugs.gnu.org; Thu, 13 May 2021 06:38:14 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41082)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lh8jM-0004TB-RN
 for 43558 <at> debbugs.gnu.org; Thu, 13 May 2021 06:38:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=3sTGpBE5iXDqA1cHaYq318Dq5KqDTuHxHwcaCh6yo5Y=; b=p/kXr0sAFukb54fj/OUKisA3ND
 o7oul23YWj+E4ueLVcSpbiGmn3T8PF5xe2fyVzbCksR8+47lo6vaQpr8OVmK6pY73kdc0eDSAF6a7
 wURZwVUmVrjYOBmXI3fNnb0v3ysfXxEHDjzolvJMUxA4NDbZDly4djLhRg/JQRSpLPx0=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lh8jC-0003Uu-Ac; Thu, 13 May 2021 12:38:04 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <20201119211822.GE6259@ACM>
 <jwvzh3d3rry.fsf-monnier+emacs@HIDDEN> <20201122131231.GB5912@ACM>
 <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
 <20201122211353.GH5912@ACM>
 <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
 <20201122220110.GI5912@ACM> <jwvk0udnh2c.fsf-monnier+emacs@HIDDEN>
X-Now-Playing: Shara Nelson's _What Silence Knows_: "What Silence Knows"
Date: Thu, 13 May 2021 12:38:01 +0200
In-Reply-To: <jwvk0udnh2c.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sun, 22 Nov 2020 18:00:40 -0500")
Message-ID: <87eeearkae.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Stefan Monnier <monnier@HIDDEN> writes: > I do want
 to clarify my position, tho: while I don't like your patch > very much because
 I think a Lisp-level solution (like the one I used in > sm-c-mode) is
 preferable I find your patch acceptable [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Stefan Monnier <monnier@HIDDEN> writes:

> I do want to clarify my position, tho: while I don't like your patch
> very much because I think a Lisp-level solution (like the one I used in
> sm-c-mode) is preferable I find your patch acceptable.

This was the patch that adds the "e" syntax modifier?  Apparently this
thread stalled here, and as far as I can see, the patch was never applied?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Alan Mackenzie <acm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 13 May 2021 14:52:03 +0000
Resent-Message-ID: <handler.43558.B43558.162091748921074 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.162091748921074
          (code B ref 43558); Thu, 13 May 2021 14:52:03 +0000
Received: (at 43558) by debbugs.gnu.org; 13 May 2021 14:51:29 +0000
Received: from localhost ([127.0.0.1]:44057 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lhCgT-0005Tp-00
	for submit <at> debbugs.gnu.org; Thu, 13 May 2021 10:51:29 -0400
Received: from colin.muc.de ([193.149.48.1]:61317 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1lhCgP-0005TO-GY
 for 43558 <at> debbugs.gnu.org; Thu, 13 May 2021 10:51:27 -0400
Received: (qmail 10475 invoked by uid 3782); 13 May 2021 14:51:18 -0000
Received: from acm.muc.de (p4fe15ecf.dip0.t-ipconnect.de [79.225.94.207])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Thu, 13 May 2021 16:51:18 +0200
Received: (qmail 11130 invoked by uid 1000); 13 May 2021 14:51:18 -0000
Date: Thu, 13 May 2021 14:51:18 +0000
Message-ID: <YJ085r9abcNUsbSd@ACM>
References: <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
 <20201122211353.GH5912@ACM>
 <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
 <20201122220110.GI5912@ACM> <jwvk0udnh2c.fsf-monnier+emacs@HIDDEN>
 <87eeearkae.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87eeearkae.fsf@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Lars.

On Thu, May 13, 2021 at 12:38:01 +0200, Lars Ingebrigtsen wrote:
> Stefan Monnier <monnier@HIDDEN> writes:

> > I do want to clarify my position, tho: while I don't like your patch
> > very much because I think a Lisp-level solution (like the one I used in
> > sm-c-mode) is preferable I find your patch acceptable.

> This was the patch that adds the "e" syntax modifier?  Apparently this
> thread stalled here, and as far as I can see, the patch was never applied?

That is correct, yes.  The patch was working and ready, but I took
Stefan's criticisms on board, and I think he was right.  It was a fairly
large change to syntax.c with a minor gain.  Also, it would have meant
having two alternative comment mechanisms in CC Mode for a few releases.
So I think on balance, it would be better to regard the patch as an
experiment only, which should go no further.

I think the bug should stay open, though.  CC Mode still doesn't handle
multi-line comments absolutely correctly, and these could surely be
fixed, like Stefan said, by using syntax-table text properties somehow.

I also created a plethora of syntax test cases for the patch, some of
which are applicable to syntax.c as is.  I'll get around to sorting
these out and committing them sometime.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 16 May 2021 13:54:01 +0000
Resent-Message-ID: <handler.43558.B43558.162117323129994 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.162117323129994
          (code B ref 43558); Sun, 16 May 2021 13:54:01 +0000
Received: (at 43558) by debbugs.gnu.org; 16 May 2021 13:53:51 +0000
Received: from localhost ([127.0.0.1]:49902 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1liHDK-0007ni-Tm
	for submit <at> debbugs.gnu.org; Sun, 16 May 2021 09:53:51 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1liHDI-0007nK-UD
 for 43558 <at> debbugs.gnu.org; Sun, 16 May 2021 09:53:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=/V8eMQDG4jb6FZGh7LDlHJs6nIEtgq+oEBJdV29Enyg=; b=BaW5Oy5RKUvZ2X4+3aL/COn17d
 mM9x0PzW/OGT2xoARRYoHzm5b+pA3gyDOtX2lHXbvrSLzym+YYg8kqxIuM4WT3bVrL2Xx5DISOvKL
 GYxaCdvvLDazp3b7ozVvtfIV8QfAp+HeZYRqWtzY2ccSslY8MG3bFOwZohTA207sf4uc=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1liHD8-0007XG-2C; Sun, 16 May 2021 15:53:41 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
 <20201122211353.GH5912@ACM>
 <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
 <20201122220110.GI5912@ACM> <jwvk0udnh2c.fsf-monnier+emacs@HIDDEN>
 <87eeearkae.fsf@HIDDEN> <YJ085r9abcNUsbSd@ACM>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEUxLCgiHRlhXFdD
 Pjr19PDEwbuGgnumo53W1M6AfHb///9QeSwYAAAAAWJLR0QKaND0VgAAAAd0SU1FB+UFEA01Ekv0
 2NMAAAGoSURBVDjLjZO9b9swEMVPUlJ5lB0IWkWLjNVNdm1UY6BQpUZ/yBCyuV2ySi0Fc3Qlu1TG
 Fh3y5zZLhpAskBvvh3ePdw8EeK0xmMuKPDOaULQwAnu5KdemSd9IPWOGYTe0gHFFkAaCnoeW4Jmn
 gWZUW5UnNeAjcj/pvUgf9dstxBo0AfhNm8pe78OoOo1v8pdnq+CKItHhtWfPlf0I/S676xpdKQDc
 B2YFxeUuDlXzwzlvT885blQFXMRs02KuAoDM8vv2mmrXcvLH0V25yPU8KFudyvlB29GZgrv7ZUtt
 w5f6QDK/cCNVkyLM8zRfUnUTHOIhJyzCGwX8PZDzQKpOfH3bT3iYDlxyShNFwUMSiww3WPNAf+JZ
 N2o+K69ylrKeRlgUvbL4eTt8Sh7Jdq8cyz0ev/iodRtLmbSw7BLX+9UPxdniefgssjJVHADkfpBb
 MSxPSn/y06/YE85WawUELJ4fWdC4WuRUJAsW7xwti/AWjtNLZkgpQJVtSg/wbh/L0AAkG0R50PvO
 PR8600e3GWbsNtHBhAVbykyKJw8+mrwhgf+W8z7wD1jTW5FlsOchAAAAJXRFWHRkYXRlOmNyZWF0
 ZQAyMDIxLTA1LTE2VDEzOjUzOjE4KzAwOjAwtOn5LwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0w
 NS0xNlQxMzo1MzoxOCswMDowMMW0QZMAAAAASUVORK5CYII=
X-Now-Playing: Rocketnumbernine's _Meyouweyou_: "Rotunda"
Date: Sun, 16 May 2021 15:53:37 +0200
In-Reply-To: <YJ085r9abcNUsbSd@ACM> (Alan Mackenzie's message of "Thu, 13 May
 2021 14:51:18 +0000")
Message-ID: <87v97iokda.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Alan Mackenzie <acm@HIDDEN> writes: > I think the bug should
 stay open,
 though. CC Mode still doesn't handle > multi-line comments absolutely
 correctly, and these could surely be > fixed, like Stefan said, by using
 syntax-table text pro [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> I think the bug should stay open, though.  CC Mode still doesn't handle
> multi-line comments absolutely correctly, and these could surely be
> fixed, like Stefan said, by using syntax-table text properties somehow.

OK; makes sense to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 16 May 2021 13:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 16 09:53:59 2021
Received: from localhost ([127.0.0.1]:49905 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1liHDT-0007o5-4T
	for submit <at> debbugs.gnu.org; Sun, 16 May 2021 09:53:59 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47136)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1liHDR-0007nq-5M
 for control <at> debbugs.gnu.org; Sun, 16 May 2021 09:53:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc:
 MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=uskETmvtIV8oktTDocU2t3ThT+Yd2j0feJ3aa/0W5bg=; b=tBxdKfEMc1tD85J0aUNPDg69Ov
 4E1tXxMQNtcSEhkw8Bup5FAO0Im3rEgwQCD+se8wpeYIgs1hsPCYD7OzMe3Ui+Zk4sDxCaD1cvp9q
 H7REskBeAIBgf68cgG5QiL9Hta6UTci2Wz2omGKXam05b1UnjJZe4I4JTqrDGybWRIqM=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1liHDJ-0007XR-J6
 for control <at> debbugs.gnu.org; Sun, 16 May 2021 15:53:51 +0200
Date: Sun, 16 May 2021 15:53:49 +0200
Message-Id: <87tun2okcy.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: control message for bug #43558
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  tags 43558 - patch quit 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 43558 - patch
quit





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 28 Apr 2022 11:18:01 +0000
Resent-Message-ID: <handler.43558.B43558.165114464627701 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 43558
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Alan Mackenzie <acm@HIDDEN>
Cc: 43558 <at> debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 43558-submit <at> debbugs.gnu.org id=B43558.165114464627701
          (code B ref 43558); Thu, 28 Apr 2022 11:18:01 +0000
Received: (at 43558) by debbugs.gnu.org; 28 Apr 2022 11:17:26 +0000
Received: from localhost ([127.0.0.1]:45574 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nk29G-0007CS-2j
	for submit <at> debbugs.gnu.org; Thu, 28 Apr 2022 07:17:26 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53456)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nk29E-000776-Lw
 for 43558 <at> debbugs.gnu.org; Thu, 28 Apr 2022 07:17:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=+NW63Qw/ahgj0GUxWNH84xMFJznVp7hSIzC1DQR7GHY=; b=r+I4jH6F/N1tE9cam3eC89ZWdL
 tLph+S7CIY1B4uKxtSHN95N1rz5c/23WI7VpK2rLVTJeqn3RMBzUuNGeUOGRzQegKocq+dMh2YRCl
 dBqznPFuuC4z7qo2QuPZhuoX6hx0jdOfArUOPuiTAFXl3P+y0vpb+LoEBJLCMbsWGB3M=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nk292-0008VS-Ra; Thu, 28 Apr 2022 13:17:15 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <jwv8sats9mc.fsf-monnier+emacs@HIDDEN> <20201122170830.GD5912@ACM>
 <d920b11d-225e-8097-9632-4ebb28fee9b4@HIDDEN>
 <20201122181957.GF5912@ACM>
 <73ccc858-dd03-248f-4b89-5679a8f3cd63@HIDDEN>
 <20201122211353.GH5912@ACM>
 <00dc580c-3b48-c185-9020-2cb2b7528884@HIDDEN>
 <20201122220110.GI5912@ACM> <jwvk0udnh2c.fsf-monnier+emacs@HIDDEN>
 <87eeearkae.fsf@HIDDEN> <YJ085r9abcNUsbSd@ACM>
X-Now-Playing: Lionrock's _This Is Fascism (1)_: "This Is Fascism (Destroy
 All Nazi's Mix)"
Date: Thu, 28 Apr 2022 13:17:12 +0200
In-Reply-To: <YJ085r9abcNUsbSd@ACM> (Alan Mackenzie's message of "Thu, 13 May
 2021 14:51:18 +0000")
Message-ID: <87ilqtmp8n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Alan Mackenzie <acm@HIDDEN> writes: > I think the bug should
 stay open,
 though. CC Mode still doesn't handle > multi-line comments absolutely
 correctly, and these could surely be > fixed, like Stefan said, by using
 syntax-table text pro [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Alan Mackenzie <acm@HIDDEN> writes:

> I think the bug should stay open, though.  CC Mode still doesn't handle
> multi-line comments absolutely correctly, and these could surely be
> fixed, like Stefan said, by using syntax-table text properties somehow.

Just to add a test case for this bug -- put this into a C file:

/*
  \*/
a */

cc-mode will highlight that as one comment (i.e., the "a" will be
coloured with the comment face), but the file won't compile, since the
comment ended at line two.  (This is in Emacs 29.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 28 Apr 2022 11:17:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 28 07:17:44 2022
Received: from localhost ([127.0.0.1]:45577 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nk29J-0007FO-Dx
	for submit <at> debbugs.gnu.org; Thu, 28 Apr 2022 07:17:44 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53468)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nk29H-00079m-J9
 for control <at> debbugs.gnu.org; Thu, 28 Apr 2022 07:17:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc:
 MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=b91TzqfbtgkXfVlzhnA9zP/Ze8TqBlZLFy7IhdqGyxk=; b=W48V1FnorppIzyr0OUaU0xzq5/
 Zk4/b5vdkz/D6VvOvte//NEwGtH6+nc1Ak2LvGLq5/EXqFdsNqyaUFXaB1XWwZVbvh64hjluJk+xm
 v18r48664l0iadnn2IoO24kYfVbfc7doDhO1oyFj4O4lTVdVuJBVvCPUI/RAwNu6wpCs=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1nk299-0008Vd-UN
 for control <at> debbugs.gnu.org; Thu, 28 Apr 2022 13:17:21 +0200
Date: Thu, 28 Apr 2022 13:17:19 +0200
Message-Id: <87h76dmp8g.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: control message for bug #43558
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  tags 43558 + confirmed quit 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

tags 43558 + confirmed
quit






Last modified: Thu, 28 Apr 2022 11:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.