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

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Tue, 22 Sep 2020 09:36:02 UTC

Severity: normal

Tags: confirmed

Full log


Message #37 received at 43558 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 43558 <at> debbugs.gnu.org,
 Mattias EngdegÄrd <mattiase <at> acm.org>
Subject: Re: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped.
Date: Thu, 24 Sep 2020 12:56:42 -0400
> 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





This bug report was last modified 3 years and 48 days ago.

Previous Next


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