emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regexp for c-or-c++-mode


From: Robert Pluim
Subject: Re: Regexp for c-or-c++-mode
Date: Wed, 10 Jun 2020 13:40:21 +0200

>>>>> On Wed, 10 Jun 2020 12:35:19 +0100, Michał Nazarewicz <mina86@mina86.com> 
>>>>> said:

    Michał> On Tue, 9 Jun 2020 at 21:13, Alan Mackenzie <acm@muc.de> wrote:
    >> On Sun, Jun 07, 2020 at 19:07:12 +0100, Michał Nazarewicz wrote:
    >> > On Sun, 7 Jun 2020 at 17:41, Alan Mackenzie <acm@muc.de> wrote:
    >> > > In c-or-c++-mode--regexp, there are several occurrences of
    >> 
    >> > >     [ \t\r]
    >> 
    >> > > .  These expressions notably lack \n.  This seems strange, given how 
\n
    >> > > is the normal line terminator in Emacs and \r is a rarely used 
artefact.
    >> 
    >> > I wanted the regex to match single-line rather than multi-line 
statements
    >> > to avoid false positives. Though, other than #include lines, either 
will
    >> > probably work equally well.
    >> 
    >> I don't fully understand.  Why have you got the \r there?

    Michał> I suppose you’re right. It should be [ \t\v\f] instead to catch
    Michał> all non-new-line white-space characters. Or [ \t\v\f\r\n] to catch
    Michał> all white-space characters.

[[:blank:]] ?

Robert



reply via email to

[Prev in Thread] Current Thread [Next in Thread]