From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Wright Newsgroups: gmane.emacs.bugs Subject: bug#15107: reproduced on emacs-25 branch Date: Sat, 5 Mar 2016 20:18:50 -0800 Message-ID: References: <87eh9uk3c6.fsf@blah.blah> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c31746339b7e052d59a529 X-Trace: ger.gmane.org 1457246186 24430 80.91.229.3 (6 Mar 2016 06:36:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2016 06:36:26 +0000 (UTC) To: 15107@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 06 07:36:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1acSIa-0001YR-1B for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Mar 2016 07:36:16 +0100 Original-Received: from localhost ([::1]:49390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acSIU-0000V6-V7 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Mar 2016 01:36:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acSIP-0000Uh-CW for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2016 01:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acSIM-0004Lw-5w for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2016 01:36:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acSIM-0004Ls-1d for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2016 01:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1acSIL-00018H-Iz for bug-gnu-emacs@gnu.org; Sun, 06 Mar 2016 01:36:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87eh9uk3c6.fsf@blah.blah> Resent-From: Michael Wright Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Mar 2016 06:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15107 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15107-submit@debbugs.gnu.org id=B15107.14572461214281 (code B ref 15107); Sun, 06 Mar 2016 06:36:01 +0000 Original-Received: (at 15107) by debbugs.gnu.org; 6 Mar 2016 06:35:21 +0000 Original-Received: from localhost ([127.0.0.1]:36080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1acSHg-00016x-JD for submit@debbugs.gnu.org; Sun, 06 Mar 2016 01:35:21 -0500 Original-Received: from mail-ig0-f178.google.com ([209.85.213.178]:32932) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1acQ9g-0005yh-4B for 15107@debbugs.gnu.org; Sat, 05 Mar 2016 23:18:56 -0500 Original-Received: by mail-ig0-f178.google.com with SMTP id ig19so2985514igb.0 for <15107@debbugs.gnu.org>; Sat, 05 Mar 2016 20:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=UFA8re6XnRuDq4Lr4tqpPF1qhWKL6SnhUvKtopeo1h0=; b=lbrifFJvYHr5/NZWu2v4v/QfvcsqUicHcUgsl5vPij9kE8FYOWn+QFx7NmshmVQ3wV Tqy/txRAYDR6RHaeU0ej3r0Q7byIle0wpTnB9y7/vgxzLj6PZM9cS/DZi4IsFZ2+unmC NRAnkg+3N7ksp5FAjFiRMXnOX+/nUE8U0z6cf3JLDie58Lsute3Gey6mewwabNA84pM6 yuTUQapL/QVt9t1yhBuEnMl95fLrOWwtcfESxY4KJxT5GpH3Z/laL8CM5BiJYbhg6/pE 7cXhqtCJ8ptgkaHFzUFp5VV04kfEfa/z20rmcVc/g/JbHhSggvq6LXcfXYrAH2e3MKPc l0yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=UFA8re6XnRuDq4Lr4tqpPF1qhWKL6SnhUvKtopeo1h0=; b=U+YBJ8vt0Lv7RDdUtoyCDJ4H4jao8rWA79mRXXRvBCduMoeH6G6wA//cZCoeLM+f3J 4z7wXKY3mAubddOf3p+nAnAwTJgsGsWCsWt3Rgj9+OL6FI3nGk/PMfxBxW/H31dIsaur Js8EvWlJBN2jdTcDoASXyhbKkEbMuDCwVnzYb0e9QXYH1luwulqMrH9+iGz3e4KsXjXL 7ssq+achl3mB1UEbqaThF2x/ixAHrDRxGAXG2G8ZgBQbQmk5M1lwoyxCsr3PsD0gX1we P5M6vT256eRXaS/+uzQT84wGuHtWLXgDI4Ohwh8Y1Grb3XNIEaPFDybNsCWpZB1Ke0EO FCCQ== X-Gm-Message-State: AD7BkJJbZwwpJyRdvcsPrVBJ6LMJh6ZkaysUL6tBonh3UJxyW5xAvxbTlFh6BaN5gy6GANwyHI0MWK1gqtzOcg== X-Received: by 10.50.160.9 with SMTP id xg9mr4046625igb.41.1457237930512; Sat, 05 Mar 2016 20:18:50 -0800 (PST) Original-Received: by 10.50.30.234 with HTTP; Sat, 5 Mar 2016 20:18:50 -0800 (PST) X-Mailman-Approved-At: Sun, 06 Mar 2016 01:35:18 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:114474 Archived-At: --001a11c31746339b7e052d59a529 Content-Type: text/plain; charset=UTF-8 Kevin Ryde writes: > replace-regexp-in-string behaves incorrectly if a regexp has \` among > its matches. > > (replace-regexp-in-string "\\`\\|X" "Z" "--XX--" t t) > => > "Z--ZXZX--" > > where I expected > > "Z--ZZ--" > > This seems to be due to the optimization in replace-regexp-in-string > which re-matches on the matched substring. \' can match the substring > where it did not match in the middle of the full string. In the example > above "X" is the match in the full string, but on taking that "X" as a > substring it can match "\\`". I built the emacs-25 git branch I recreated the above bug today. GNU Emacs 25.0.92.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1507)) of 2016-03-05 --001a11c31746339b7e052d59a529 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Kevin Ryde <u= ser42@zip.com.au> writes:

> replace-= regexp-in-string behaves incorrectly if a regexp has \` among
>= ; its matches.
>
> =C2=A0 =C2=A0 (replace-regexp-= in-string "\\`\\|X" "Z" "--XX--" t t)
> =C2=A0 =C2=A0 =3D>
> =C2=A0 =C2=A0 "Z--ZXZX--&= quot;
>
> where I expected
>
> =C2=A0 =C2=A0 "Z--ZZ--"
>
> Thi= s seems to be due to the optimization in replace-regexp-in-string
> which re-matches on the matched substring. =C2=A0\' can match the= substring
> where it did not match in the middle of the full = string.=C2=A0 In the example
> above "X" is the matc= h in the full string, but on taking that "X" as a
> = substring it can match "\\`".

I built th= e emacs-25 git branch I recreated the above bug today.=C2=A0

=
GNU Emacs 25.0.92.1 (x86_64-apple-darwin13.4.0, NS appkit-1= 265.21 Version 10.9.5 (Build 13F1507))
=C2=A0of 2016-03-05
<= /div>
--001a11c31746339b7e052d59a529--