From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. Date: Thu, 24 Sep 2020 12:56:42 -0400 Message-ID: References: <20200923144824.GD6178@ACM> <20200924102022.GA4714@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2698"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43558@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 24 18:57: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 1kLUYY-0000aw-W6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Sep 2020 18:57:18 +0200 Original-Received: from localhost ([::1]:34296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLUYY-0007WD-0G for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Sep 2020 12:57:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLUYI-0007To-J8 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 12:57:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58199) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLUYI-0003gn-8n for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 12:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kLUYI-0001gx-4W for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2020 12:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Sep 2020 16:57: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.16009666126486 (code B ref 43558); Thu, 24 Sep 2020 16:57:02 +0000 Original-Received: (at 43558) by debbugs.gnu.org; 24 Sep 2020 16:56:52 +0000 Original-Received: from localhost ([127.0.0.1]:41512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLUY8-0001gW-Jz for submit@debbugs.gnu.org; Thu, 24 Sep 2020 12:56:52 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kLUY7-0001gG-CC for 43558@debbugs.gnu.org; Thu, 24 Sep 2020 12:56:51 -0400 Original-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) Original-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== Original-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) In-Reply-To: <20200924102022.GA4714@ACM> (Alan Mackenzie's message of "Thu, 24 Sep 2020 10:20:22 +0000") 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:188885 Archived-At: > 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