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: Sun, 22 Nov 2020 21:13:53 +0000 Message-ID: <20201122211353.GH5912@ACM> References: <20200924102022.GA4714@ACM> <20201119211822.GE6259@ACM> <20201122131231.GB5912@ACM> <20201122170830.GD5912@ACM> <20201122181957.GF5912@ACM> <73ccc858-dd03-248f-4b89-5679a8f3cd63@yandex.ru> 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="36770"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43558@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 22 22:15:21 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 1kgwhc-0009Sv-S3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 22:15:20 +0100 Original-Received: from localhost ([::1]:46836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgwhb-0004Ni-VI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 16:15:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgwhK-0004Mj-Cv for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:15:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgwhK-0004dY-5Y for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kgwhK-0007jE-1J for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Nov 2020 21:15:01 +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.160607964529627 (code B ref 43558); Sun, 22 Nov 2020 21:15:01 +0000 Original-Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 21:14:05 +0000 Original-Received: from localhost ([127.0.0.1]:48433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgwgP-0007hn-J4 for submit@debbugs.gnu.org; Sun, 22 Nov 2020 16:14:05 -0500 Original-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 ) id 1kgwgK-0007h5-TE for 43558@debbugs.gnu.org; Sun, 22 Nov 2020 16:14:04 -0500 Original-Received: (qmail 62978 invoked by uid 3782); 22 Nov 2020 21:13:54 -0000 Original-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 Original-Received: (qmail 13032 invoked by uid 1000); 22 Nov 2020 21:13:53 -0000 Content-Disposition: inline In-Reply-To: <73ccc858-dd03-248f-4b89-5679a8f3cd63@yandex.ru> 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:193879 Archived-At: 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).