From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: :alnum: broken? Date: Sun, 23 Feb 2020 10:13:16 -0800 Organization: UCLA Computer Science Department Message-ID: References: <86wo8flqct.fsf@stephe-leake.org> <86sgj3ljf0.fsf@stephe-leake.org> <5fecc0e1-1ee2-5a89-9297-b0b9aa4a8e9c@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="128460"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 Cc: Stephen Leake , emacs-devel To: =?UTF-8?Q?Mattias_Engdeg=c3=a5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 23 19:13:58 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 1j5vlN-000XJw-U4 for ged-emacs-devel@m.gmane-mx.org; Sun, 23 Feb 2020 19:13:57 +0100 Original-Received: from localhost ([::1]:55514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5vlN-0005x6-0H for ged-emacs-devel@m.gmane-mx.org; Sun, 23 Feb 2020 13:13:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40262) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5vkt-0005VU-ET for emacs-devel@gnu.org; Sun, 23 Feb 2020 13:13:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5vkp-00004x-6D for emacs-devel@gnu.org; Sun, 23 Feb 2020 13:13:26 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:38116) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j5vkp-0008WQ-0x for emacs-devel@gnu.org; Sun, 23 Feb 2020 13:13:23 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 70FD2160091; Sun, 23 Feb 2020 10:13:21 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id b_Y41Dmie4ON; Sun, 23 Feb 2020 10:13:20 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B77BF160093; Sun, 23 Feb 2020 10:13:20 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1UbQU1xMmP8T; Sun, 23 Feb 2020 10:13:20 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8F1EF160091; Sun, 23 Feb 2020 10:13:20 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 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:245045 Archived-At: On 2/23/20 2:21 AM, Mattias Engdeg=C3=A5rd wrote: >> GNU grep treats a bracket expression like '[:space:]' as an error, sin= ce it's inevitably a typo.... > Such a check is obviously unsound, strictly speaking, which may be a re= ason for objecting to it. I understand the objection, but the check is not unsound. The syntax of r= egexps=20 was not carved in stone by God. It is something that we decide, and we ca= n=20 change our minds if the change would be an overall win, as it would be if= Emacs=20 behaved like Grep. When the [[:alnum:]] syntax was added to regular expressions many years a= go, it=20 invalidated some astronomically-unlikely but formerly-valid expressions. = For=20 example, "[[:x:]" formerly was a valid regexp (with the same meaning as "= [:[x]")=20 but it is now invalid. So there is precedent for invalidating some=20 astronomically-unlikely regexps when the overall change is a net benefit,= as it=20 would be if Emacs behaved like Grep. The byte-compiler could warn about some of these blunders and if someone = wants=20 to change the byte-compiler to do that, it would be an improvement. Howev= er,=20 this would necessarily either cry wolf or let blunders through, because t= he=20 byte-compiler cannot reliably determine whether a string will be used as = a=20 regular expression.