From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?ISO-8859-1?Q?Engdeg=E5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Forbid reverse ranges in rx Date: Tue, 12 Mar 2019 16:26:23 +0100 Message-ID: <458975ce0c15165e6a6e62cbda75c8b912a59d8f.camel@acm.org> References: <50fb83052c1de4da59f0a857deed2e5d9e533c13.camel@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="120056"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) To: =?ISO-8859-1?Q?Cl=E9ment?= Pit-Claudel , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 12 16:29:03 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h3jKw-000V1b-AV for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 16:29:02 +0100 Original-Received: from localhost ([127.0.0.1]:54384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3jKv-0003vh-A7 for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2019 11:29:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3jIT-0002L5-MH for emacs-devel@gnu.org; Tue, 12 Mar 2019 11:26:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3jIS-0001aV-Nl for emacs-devel@gnu.org; Tue, 12 Mar 2019 11:26:29 -0400 Original-Received: from mail150c50.megamailservers.eu ([91.136.10.160]:39814 helo=mail50c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3jIR-0001YT-Qy for emacs-devel@gnu.org; Tue, 12 Mar 2019 11:26:28 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1552404385; bh=bE5TSWUaeG1TQDlDj5tBURpjmrB3ouHgPGlNw/g+RTc=; h=Subject:From:To:Date:In-Reply-To:References:From; b=S68FjkBtFtdzH93R7+u5JPwLIARKD6E9DXppBvAahigcMQUd7IrJNnn7+GIPAXDQa eK6LzXfp1aB3AyPb50AGxMzsMrJD+SDm3zL1efZBbApXXlEgwvk+vysQgw2LOlg8Kd f8C0B8EFQnwvFD3I/d3rjy6bHahX6ghQcdQ/U55A= Feedback-ID: mattiase@acm.or Original-Received: from dhcppc1 (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail50c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x2CFQNcp011179; Tue, 12 Mar 2019 15:26:24 +0000 In-Reply-To: X-CTCH-RefID: str=0001.0A0B0203.5C87CFA1.002B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=a4UeC3aF c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=I6VJg9lmZNjmpfgRb4QA:9 a=QEXdDO2ut3YA:10 X-MIME-Autoconverted: from 8bit to quoted-printable by mail50c50.megamailservers.eu id x2CFQNcp011179 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.160 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234100 Archived-At: tis 2019-03-12 klockan 10:27 -0400 skrev Cl=C3=A9ment Pit-Claudel: > I worry that maybe we should make this a warning, rather than an > error, since there are lots of poorly supported but decently working > Emacs modes out there. This change will make some of these (subtly > broken) modes unusable (we've seen that e.g. the change to comint > caused some breakage, so I think we should be especially careful).=20 The risk of breaking anything should be substantially lower for rx, since reverse ranges are less likely to occur by accident than in string regexps, and because rx is just much less frequently used. > I'd love to see all these errors detected by xr as warnings in the > byte-compiler. I don't want to make a separate linter for rx; it should protect its own abstractions. That's another reason for the change: we don't want to end up with lots of ill-defined syntax and semantics that cannot be changed for legacy reasons. For that matter, the latest version of trawl does evaluate most rx forms that are used as regexps, so rx errors there stand a good chance of being detected. > Also, if we make this an error in rx, should we also make it an error > in regular regexps? I would like to, but as you say there is lots of code that work well enough despite little mistakes. There is also wilful abuse: auctex uses [^z-a] as "any character". > > + (error "Reverse range `%c-%c' in Rx `any' > > not permitted" > > + start end))) >=20 > Consider rephrasing this to explain why it's not permitted (maybe "=E2=80= =A6 > no permitted, as it does not match anything"). Do we really need to mention the legacy semantics, which were accidental and arbitrary? "Z-A" is disallowed because it doesn't make sense, not because of what happened before we thought of checking.