From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." Date: Fri, 22 May 2020 12:46:03 +0200 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_8B9F84BB-81FA-413B-B6D2-B52CC23BB2FA" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="51657"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 41445@debbugs.gnu.org To: Ture =?UTF-8?Q?P=C3=A5lsson?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 22 12:47:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jc5Cn-000DEi-Iq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 May 2020 12:47:09 +0200 Original-Received: from localhost ([::1]:35126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc5Cm-0004l5-Lz for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 May 2020 06:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc5Cg-0004kn-6X for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 06:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46593) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jc5Cf-0001g6-TZ for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 06:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jc5Cf-0008Fn-RX for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 06:47:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 May 2020 10:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41445 X-GNU-PR-Package: emacs Original-Received: via spool by 41445-submit@debbugs.gnu.org id=B41445.159014438031669 (code B ref 41445); Fri, 22 May 2020 10:47:01 +0000 Original-Received: (at 41445) by debbugs.gnu.org; 22 May 2020 10:46:20 +0000 Original-Received: from localhost ([127.0.0.1]:58139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc5Bx-0008EZ-0D for submit@debbugs.gnu.org; Fri, 22 May 2020 06:46:20 -0400 Original-Received: from mail204c50.megamailservers.eu ([91.136.10.214]:35904 helo=mail193c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc5Bo-0008EC-Fo; Fri, 22 May 2020 06:46:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1590144366; bh=/UP2SDJSecbRrt6xxJKPSVMhdow75nbFI6xNAf5jkdU=; h=From:Date:Subject:Cc:To:From; b=MtccXuhPc4yIX6hgGYihF2IGjd1ePWd6c/pNzGHyjI29QrbSU/1iHZZEISSWAP+SW qTj37LWx/W27F3ANPcmJfvtgYEsL/chBFdRjq5+rBJ6UUQsyBmid9McGFqWsHD1o0G cedVTtQD2ZZjwe4DUZIRvE0vMwNJoO2nsiDiY18c= Feedback-ID: mattiase@acm.or Original-Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04MAk3f7024458; Fri, 22 May 2020 10:46:05 +0000 X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F20.5EC7ACF0.0015:SCFSTAT68638221, ss=1, re=-4.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: -4.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=cM2eTWWN c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=M51BFTxLslgA:10 a=u6k3N8fo-Y5wVBJ_FJoA:9 a=CjuIK1q_8ugA:10 a=wzIG3FNt2CT_li0VqwcA:9 a=B2y7HmGcmWMA:10 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180742 Archived-At: --Apple-Mail=_8B9F84BB-81FA-413B-B6D2-B52CC23BB2FA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii tags 41445 patch stop Thank you! Clearly nobody expects normalisation functions to clobber = match data. --Apple-Mail=_8B9F84BB-81FA-413B-B6D2-B52CC23BB2FA Content-Disposition: attachment; filename=0001-Don-t-clobber-match-data-in-Unicode-normalisation-bu.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Don-t-clobber-match-data-in-Unicode-normalisation-bu.patch" Content-Transfer-Encoding: quoted-printable =46rom=20851cbe5507e872d8649d457889c4f87395bd63c2=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Fri,=2022=20May=202020=2012:21:28=20+0200=0A= Subject:=20[PATCH]=20Don't=20clobber=20match=20data=20in=20Unicode=20= normalisation=20(bug#41445)=0AMIME-Version:=201.0=0AContent-Type:=20= text/plain;=20charset=3DUTF-8=0AContent-Transfer-Encoding:=208bit=0A=0A= Suggested=20by=20Ture=20P=C3=A5lsson.=0A=0A*=20= lisp/international/ucs-normalize.el=20(ucs-normalize-region):=0AWrap=20= regexp=20searches=20in=20save-match-data.=0A*=20= test/lisp/international/ucs-normalize-tests.el=0A= (ucs-normalize-save-match-data):=20New=20test.=0A---=0A=20= lisp/international/ucs-normalize.el=20=20=20=20=20=20=20=20=20=20=20|=20= 33=20++++++++++---------=0A=20= .../lisp/international/ucs-normalize-tests.el=20|=2011=20+++++++=0A=202=20= files=20changed,=2028=20insertions(+),=2016=20deletions(-)=0A=0Adiff=20= --git=20a/lisp/international/ucs-normalize.el=20= b/lisp/international/ucs-normalize.el=0Aindex=20201ff6b9b1..6bc08c247b=20= 100644=0A---=20a/lisp/international/ucs-normalize.el=0A+++=20= b/lisp/international/ucs-normalize.el=0A@@=20-511,22=20+511,23=20@@=20= ucs-normalize-region=0A=20COMPOSITION-PREDICATE=20will=20be=20used=20to=20= compose=20region."=0A=20=20=20(save-excursion=0A=20=20=20=20=20= (save-restriction=0A-=20=20=20=20=20=20(narrow-to-region=20from=20to)=0A= -=20=20=20=20=20=20(goto-char=20(point-min))=0A-=20=20=20=20=20=20(let=20= (start-pos=20starter)=0A-=20=20=20=20=20=20=20=20(while=20= (re-search-forward=20quick-check-regexp=20nil=20t)=0A-=20=20=20=20=20=20=20= =20=20=20(setq=20starter=20(string-to-char=20(match-string=200)))=0A-=20=20= =20=20=20=20=20=20=20=20(setq=20start-pos=20(match-beginning=200))=0A-=20= =20=20=20=20=20=20=20=20=20(ucs-normalize-block=0A-=20=20=20=20=20=20=20=20= =20=20=20;;=20from=0A-=20=20=20=20=20=20=20=20=20=20=20(if=20(or=20(=3D=20= start-pos=20(point-min))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(and=20(=3D=200=20(ucs-normalize-ccc=20starter))=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= (memq=20starter=20ucs-normalize-combining-chars))))=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20start-pos=20(1-=20start-pos))=0A-=20=20=20=20=20= =20=20=20=20=20=20;;=20to=0A-=20=20=20=20=20=20=20=20=20=20=20(if=20= (looking-at=20ucs-normalize-combining-chars-regexp)=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(match-end=200)=20(1+=20start-pos))=0A-=20=20=20= =20=20=20=20=20=20=20=20translation-table=20composition-predicate))))))=0A= +=20=20=20=20=20=20(save-match-data=0A+=20=20=20=20=20=20=20=20= (narrow-to-region=20from=20to)=0A+=20=20=20=20=20=20=20=20(goto-char=20= (point-min))=0A+=20=20=20=20=20=20=20=20(let=20(start-pos=20starter)=0A+=20= =20=20=20=20=20=20=20=20=20(while=20(re-search-forward=20= quick-check-regexp=20nil=20t)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20starter=20(string-to-char=20(match-string=200)))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20(setq=20start-pos=20(match-beginning=200))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20(ucs-normalize-block=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20;;=20from=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (if=20(or=20(=3D=20start-pos=20(point-min))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(and=20(=3D=200=20(ucs-normalize-ccc=20= starter))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(not=20(memq=20starter=20= ucs-normalize-combining-chars))))=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20start-pos=20(1-=20start-pos))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20to=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (looking-at=20ucs-normalize-combining-chars-regexp)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(match-end=200)=20(1+=20start-pos))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20translation-table=20= composition-predicate)))))))=0A=20=0A=20;;=20= --------------------------------------------------------------------------= ------=0A=20=0Adiff=20--git=20= a/test/lisp/international/ucs-normalize-tests.el=20= b/test/lisp/international/ucs-normalize-tests.el=0Aindex=20= c36808ad72..2c60bd318a=20100644=0A---=20= a/test/lisp/international/ucs-normalize-tests.el=0A+++=20= b/test/lisp/international/ucs-normalize-tests.el=0A@@=20-341,4=20+341,15=20= @@=20ucs-normalize-check-failing-lines=0A=20=20=20=20=20=20=20=20=20=20=20= (display-buffer=20(current-buffer)))=0A=20=20=20=20=20=20=20(message=20= "No=20changes=20to=20failing=20lines=20needed"))))=0A=20=0A+(ert-deftest=20= ucs-normalize-save-match-data=20()=0A+=20=20"Verify=20that=20match=20= data=20isn't=20clobbered=20(bug#41445)"=0A+=20=20(string-match=20(rx=20= (+=20digit))=20"a47b")=0A+=20=20(should=20(equal=20(match-data=20t)=20= '(1=203)))=0A+=20=20(should=20(equal=0A+=20=20=20=20=20=20=20=20=20=20=20= (decode-coding-string=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (encode-coding-string=20"K=C3=A4seso=C3=9Fenr=C3=BChrl=C3=B6ffel"=20= 'utf-8-hfs)=0A+=20=20=20=20=20=20=20=20=20=20=20=20'utf-8-hfs)=0A+=20=20=20= =20=20=20=20=20=20=20=20"K=C3=A4seso=C3=9Fenr=C3=BChrl=C3=B6ffel"))=0A+=20= =20(should=20(equal=20(match-data=20t)=20'(1=203))))=0A+=0A=20;;;=20= ucs-normalize-tests.el=20ends=20here=0A--=20=0A2.21.1=20(Apple=20= Git-122.3)=0A=0A= --Apple-Mail=_8B9F84BB-81FA-413B-B6D2-B52CC23BB2FA--