From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Micha=C5=82_Nazarewicz?= Newsgroups: gmane.emacs.devel Subject: Re: Regexp for c-or-c++-mode Date: Wed, 10 Jun 2020 12:35:19 +0100 Message-ID: References: <20200607164100.GB6212@ACM> <20200609201255.GB7104@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="130290"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 10 13:36:32 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jiz1z-000XnX-FQ for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Jun 2020 13:36:31 +0200 Original-Received: from localhost ([::1]:58798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiz1y-0003c2-F6 for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Jun 2020 07:36:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiz1A-0002m6-08 for emacs-devel@gnu.org; Wed, 10 Jun 2020 07:35:40 -0400 Original-Received: from mail-wm1-f44.google.com ([209.85.128.44]:37370) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiz18-0006dv-Ka for emacs-devel@gnu.org; Wed, 10 Jun 2020 07:35:39 -0400 Original-Received: by mail-wm1-f44.google.com with SMTP id y20so1507582wmi.2 for ; Wed, 10 Jun 2020 04:35:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=OdjUjsXPwtyPA25D8dOWlIf2JrWbgEIDqHLGBTFQ9CI=; b=o2lBr1EFJbb6rdGdXBqs1VAL0YmBdxDCnVxjxD4GoEcqNRWHRTSbx22a9mfEsyrR8O JCCFHwLt9jDaZfBGthJbEj5deIrL68llc1ONFKsg2vhV6xdH5Czx5mFBYJgsNaZxhV2q eT/BVdsQCnXgpMkabhQear7pYxr9n5F9fF7lttHovNFVyVupy8YNENcOOomfhUsl7z7x AZl2o/i3scWfPiUDjf/HyOWkW0Nq3b2afJyil7poBrRzWAaBuahfkrUIFwzu+XKTl+3r Abt7t/OyI+5e9ERiGXkoFKZg1TIZ25CcqmaWYU5Sk9ipeVAkZfXUhRITJ/VeoJ7BnQhM OOlg== X-Gm-Message-State: AOAM532FVIU3+dKLuIsEzHxaMTNWL5Gu0+mlkYVGBaa6qu+I4nMVKY5d jxwNpy9UQBr87pFoBSajlVcakzyAwm888w6Ks6UuqA61wCs= X-Google-Smtp-Source: ABdhPJwaMEMqv8xKvz286sSFLQHhgEzsHVg6MWZyiV+pD07/0Dtg81B06IcRqeQtlZwjurAu1Sj1m/jlyFhCluO7pUU= X-Received: by 2002:a05:600c:224f:: with SMTP id a15mr2740258wmm.166.1591788929928; Wed, 10 Jun 2020 04:35:29 -0700 (PDT) In-Reply-To: <20200609201255.GB7104@ACM> Received-SPF: pass client-ip=209.85.128.44; envelope-from=mnazarewicz@gmail.com; helo=mail-wm1-f44.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/10 07:35:32 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252068 Archived-At: On Tue, 9 Jun 2020 at 21:13, Alan Mackenzie wrote: > On Sun, Jun 07, 2020 at 19:07:12 +0100, Micha=C5=82 Nazarewicz wrote: > > On Sun, 7 Jun 2020 at 17:41, Alan Mackenzie 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 artefa= ct. > > > I wanted the regex to match single-line rather than multi-line statemen= ts > > to avoid false positives. Though, other than #include lines, either wil= l > > probably work equally well. > > I don't fully understand. Why have you got the \r there? I suppose you=E2=80=99re right. It should be [ \t\v\f] instead to catch all non-new-line white-space characters. Or [ \t\v\f\r\n] to catch all white-space characters. --=20 Best regards =E3=83=9F=E3=83=8F=E3=82=A6 =E2=80=9C=F0=9D=93=B6=F0=9D=93=B2=F0=9D=93=B7= =F0=9D=93=AA86=E2=80=9D =E3=83=8A=E3=82=B6=E3=83=AC=E3=83=B4=E3=82=A4=E3=83= =84 =C2=ABIf at first you don=E2=80=99t succeed, give up skydiving=C2=BB