From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. Date: Wed, 23 Sep 2020 19:44:41 +0000 Message-ID: <20200923194441.GE6178@ACM> References: <20200923144824.GD6178@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6136"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43558@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 23 21:48:19 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kLAkU-0001UD-K9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 21:48:18 +0200 Original-Received: from localhost ([::1]:49632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLAkQ-0005r9-Gc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 15:48:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLAhK-0003TA-Iu for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2020 15:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLAhK-0001SY-6Y for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2020 15:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLAhK-00005K-4F for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2020 15:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Sep 2020 19:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43558 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 43558-submit@debbugs.gnu.org id=B43558.160089029232748 (code B ref 43558); Wed, 23 Sep 2020 19:45:02 +0000 Original-Received: (at 43558) by debbugs.gnu.org; 23 Sep 2020 19:44:52 +0000 Original-Received: from localhost ([127.0.0.1]:37924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLAhA-0008W7-2g for submit@debbugs.gnu.org; Wed, 23 Sep 2020 15:44:52 -0400 Original-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 ) id 1kLAh6-0008Vi-UH for 43558@debbugs.gnu.org; Wed, 23 Sep 2020 15:44:50 -0400 Original-Received: (qmail 97817 invoked by uid 3782); 23 Sep 2020 19:44:42 -0000 Original-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 Original-Received: (qmail 31789 invoked by uid 1000); 23 Sep 2020 19:44:41 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188825 Archived-At: 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).