From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Scan of regexps in emacs Date: Mon, 11 Mar 2019 09:39:20 +0100 Message-ID: <2662A315-70DC-4B67-9AA8-CABC7662B34E@acm.org> References: <9f6f677b29f514c5f0bb1bb805e89d62eb146999.camel@acm.org> <58352543-82ea-6595-cc71-f3d1949338d0@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) 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="217487"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?utf-8?Q?Cl=C3=A9ment_Pit-Claudel?= , emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 11 09:43:26 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 1h3GWs-000uN3-C3 for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 09:43:26 +0100 Original-Received: from localhost ([127.0.0.1]:57368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3GWr-000100-9E for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2019 04:43:25 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3GTD-0007Gm-Vr for emacs-devel@gnu.org; Mon, 11 Mar 2019 04:39:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3GTD-0004y0-0W for emacs-devel@gnu.org; Mon, 11 Mar 2019 04:39:39 -0400 Original-Received: from mail153c50.megamailservers.eu ([91.136.10.163]:46262 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 1h3GTC-0004uH-5Q for emacs-devel@gnu.org; Mon, 11 Mar 2019 04:39:38 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1552293563; bh=i8XQrblgZj+5t2r72HhFgwgqLbhGGz7vBVi1AhQuq+A=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=mhWpuUpiWg45kU4+0JCrsCeIgbmsj1VBl6G+1l25rzIH4ay38+2pHuTqvzfoSfvEA tQDQ/x8lIIJf8ex4ISG7zrejwdYt3FJBaAcXcX05yEQaObrgwBOSwiHU047lwlXsyl oBrIUVxBTIkCJS50L6VD7mtbrs03bUG0mS8sp0BE= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.1.64] (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 x2B8dLeW008074; Mon, 11 Mar 2019 08:39:22 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B0201.5C861EBB.003F, 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=IkcTkHD0fZMA:10 a=jkYgp2KIYOO6gpB0evsA:9 a=QEXdDO2ut3YA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.163 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:234056 Archived-At: 11 mars 2019 kl. 04.37 skrev Paul Eggert : >=20 > 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. >=20 > Yes and no. Yes, it altered the meaning of the regexp, but no it = should fix a bug rather than introduce one because comint-prompt-regexp = in practice always seems to be anchored to a line start. For example, = comint-prompt-regexp defaults to "^", which meant that the above code's = entire regexp was this: >=20 > \(^^\)\1+ One way would be to replace the "\\(^" prefix with "\\(?:^\\)\\(", which = should work whether or not comint-prompt-regexp begins with a ^. = However, as you say, comint-prompt-regexp always seems to include the ^ = and I think it is used elsewhere with the tacit assumption that it does, = so the committed change should be fine.