From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Scan of regexps in emacs Date: Sun, 10 Mar 2019 20:37:19 -0700 Organization: UCLA Computer Science Department Message-ID: References: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org> <58352543-82ea-6595-cc71-f3d1949338d0@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="240956"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 Cc: emacs-devel@gnu.org To: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 11 04:37:29 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 1h3Bkn-0010bU-6H for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 04:37:29 +0100 Original-Received: from localhost ([127.0.0.1]:54740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Bkm-0000DZ-77 for ged-emacs-devel@m.gmane.org; Sun, 10 Mar 2019 23:37:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3Bkh-0000DT-5v for emacs-devel@gnu.org; Sun, 10 Mar 2019 23:37:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3Bkg-0002ys-Fd for emacs-devel@gnu.org; Sun, 10 Mar 2019 23:37:23 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:40410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3Bkg-0002xt-9g for emacs-devel@gnu.org; Sun, 10 Mar 2019 23:37:22 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id BDE6B16147D; Sun, 10 Mar 2019 20:37:20 -0700 (PDT) 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 1A-TWhT0xBjo; Sun, 10 Mar 2019 20:37:20 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0FE1E16155B; Sun, 10 Mar 2019 20:37:20 -0700 (PDT) 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 42nTTU0gRjlI; Sun, 10 Mar 2019 20:37:19 -0700 (PDT) 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 E1B651612C8; Sun, 10 Mar 2019 20:37:19 -0700 (PDT) In-Reply-To: <58352543-82ea-6595-cc71-f3d1949338d0@gmail.com> 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.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:234051 Archived-At: Cl=C3=A9ment Pit-Claudel wrote: > On 10/03/2019 22.45, Paul Eggert wrote: >> - (while (string-match (concat "\\(^" comint-prompt-regexp >> + (while (string-match (concat "\\(" comint-prompt-regexp >> "\\)\\1+") >> string) > I think your change altered the meaning of that regexp. Yes and no. Yes, it altered the meaning of the regexp, but no it should f= ix a=20 bug rather than introduce one because comint-prompt-regexp in practice al= ways=20 seems to be anchored to a line start. For example, comint-prompt-regexp d= efaults=20 to "^", which meant that the above code's entire regexp was this: \(^^\)\1+ which is equivalent to this regexp: \(^\^\)\1+ which is not what was wanted.