From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 01:55:36 2020 Received: (at submit) by debbugs.gnu.org; 22 May 2020 05:55:36 +0000 Received: from localhost ([127.0.0.1]:57884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc0eb-0007NE-GW for submit@debbugs.gnu.org; Fri, 22 May 2020 01:55:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:41304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc0A6-0006aw-9k for submit@debbugs.gnu.org; Fri, 22 May 2020 01:24:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc0A6-0003wO-4k for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 01:24:02 -0400 Received: from mail.lysator.liu.se ([130.236.254.3]:47371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc0A1-0002kY-OK for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 01:24:01 -0400 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 1695140010 for ; Fri, 22 May 2020 07:23:43 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 03E4040012; Fri, 22 May 2020 07:23:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.2 X-Spam-Score: -0.8 Received: from pommac.localdomain (c-e27871d5.012-237-73746f22.bbcust.telenor.se [213.113.120.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 94BD740010; Fri, 22 May 2020 07:23:40 +0200 (CEST) Received: by pommac.localdomain (Postfix, from userid 501) id 4EA45302E3CC9B; Fri, 22 May 2020 07:23:38 +0200 (CEST) From: ture@turepalsson.se (Ture =?utf-8?Q?P=C3=A5lsson?=) To: bug-gnu-emacs@gnu.org Subject: 26.3; Query-replace triggers "match data clobbered by..." Date: Fri, 22 May 2020 07:07:24 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: ClamAV using ClamSMTP Received-SPF: pass client-ip=130.236.254.3; envelope-from=SRS0+e5b6=7E=turepalsson.se=ture@lysator.liu.se; helo=mail.lysator.liu.se X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/22 01:23:43 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 22 May 2020 01:55:32 -0400 Cc: ture@turepalsson.se X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 1. Run macOS (Catalina, in my case, but I don't think it matters.) 2. Have a folder named "=C3=A4" (that's a single character, U+00E4) and a file in it. 3. Visit that file. 4. While the file is not modified, do a query-replace that will replace something. 5. When Emacs asks about the first replacement, type 'y'. =3D=3D> You get an error message, "Match data clobbered by buffer modification hooks". Setting before-change-functions, after-change-functions, and first-change-hook all to nil does not make the problem go away. However, setting inhibit-modification-hooks to t *does* make it go away. Running Emacs in a debugger, I notice that the first modification of the buffer calls lock_file, which calls code_convert_string which, through a long series of Emacs Lisp calls end up calling re-search-forward. I have not tried to unravel this call chain, but: The function ucs-normalize-region calls re-search-forward. If I wrap that call in save-match-data, the problem goes away! In GNU Emacs 26.3 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Ve= rsion 10.14.3 (Build 18D109)) of 2019-09-02 built on builder10-14.porkrind.org Windowing system distributor 'Apple', version 10.3.1894 Recent messages: Mark saved where search started Mark set Mark saved where search started Mark set Mark saved where search started Making completion list... Quit Auto-saving... Saving file /Users/ture/Desktop/emacs/lisp/international/ucs-normalize.el... Wrote /Users/ture/Desktop/emacs/lisp/international/ucs-normalize.el Quit Configured using: 'configure --with-ns '--enable-locallisppath=3D/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS Important settings: value of $LC_CTYPE: sv_SE.UTF-8 value of $LANG: en_SE.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: shell-dirtrack-mode: t bug-reference-prog-mode: t diff-auto-refine-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils completion pulse find-dired semantic/fw xref project dired-aux dired dired-loaddefs ibuf-ext ibuffer ibuffer-loaddefs loadhist mode-local find-func apropos shell pcomplete grep compile comint ring bug-reference map cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs pp cl-print thingatpt help-fns radix-tree jka-compr info misearch multi-isearch vc-git diff-mode easy-mmode view elec-pair ansi-color iso-transl cl-extra help-mode cl finder-inf package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 411912 23871) (symbols 48 28246 5) (miscs 40 341 2088) (strings 32 61990 7915) (string-bytes 1 1687293) (vectors 16 52073) (vector-slots 8 1712291 139060) (floats 8 71 567) (intervals 56 32656 600) (buffers 992 37)) From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 06:46:20 2020 Received: (at 41445) by debbugs.gnu.org; 22 May 2020 10:46:20 +0000 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 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 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 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_8B9F84BB-81FA-413B-B6D2-B52CC23BB2FA" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Date: Fri, 22 May 2020 12:46:03 +0200 Subject: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." To: =?utf-8?Q?Ture_P=C3=A5lsson?= Message-Id: 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-Rules: 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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 41445 Cc: 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --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-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 07:11:57 2020 Received: (at 41445) by debbugs.gnu.org; 22 May 2020 11:11:58 +0000 Received: from localhost ([127.0.0.1]:58160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc5an-0002ZC-Mx for submit@debbugs.gnu.org; Fri, 22 May 2020 07:11:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc5ad-0002Ys-MM for 41445@debbugs.gnu.org; Fri, 22 May 2020 07:11:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41662) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc5aX-0005FW-02; Fri, 22 May 2020 07:11:41 -0400 Received: from [176.228.60.248] (port=1053 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jc5aW-0001hq-7Q; Fri, 22 May 2020 07:11:40 -0400 Date: Fri, 22 May 2020 14:11:44 +0300 Message-Id: <83367s4427.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 22 May 2020 12:46:03 +0200) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 22 May 2020 12:46:03 +0200 > Cc: 41445@debbugs.gnu.org > > Thank you! Clearly nobody expects normalisation functions to clobber match data. Is that the right place to save-match-data, though? Should we perhaps do that where utf-8-hfs file names are encoded? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 07:16:12 2020 Received: (at 41445) by debbugs.gnu.org; 22 May 2020 11:16:12 +0000 Received: from localhost ([127.0.0.1]:58175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc5eu-0002gF-7Q for submit@debbugs.gnu.org; Fri, 22 May 2020 07:16:12 -0400 Received: from mail178c50.megamailservers.eu ([91.136.10.188]:41566 helo=mail70c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc5er-0002g4-Mr for 41445@debbugs.gnu.org; Fri, 22 May 2020 07:16:10 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1590146167; bh=HLhKuWii4KfpvUd13tw/YY5yiruHPw0/6RPIgpv04jc=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=scSDJdVm9cNJOABJ3xAQHxXX2+31t0WnfGByqeuWU0e61m1KhQOaqhz1YsRnWvArB GbSbV38NPJmV7SCmaTggn/itCfMNaPW5X9qX/e6spYpFCICQNC1dkTdLsKLAZIFzER Ldcf1DJKE1exL1uRU7HNJX2eU4SUiEtPqZ1aqAKY= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04MBG4kr007445; Fri, 22 May 2020 11:16:06 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83367s4427.fsf@gnu.org> Date: Fri, 22 May 2020 13:16:04 +0200 Content-Transfer-Encoding: 7bit Message-Id: <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> References: <83367s4427.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F27.5EC7B42F.000C: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=OKBZIhSB c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=0BR4sqtr0PjXxpadsQwA:9 a=CjuIK1q_8ugA:10 a=ncZ9vwaUYPMA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 22 maj 2020 kl. 13.11 skrev Eli Zaretskii : > Is that the right place to save-match-data, though? Should we perhaps > do that where utf-8-hfs file names are encoded? What location did you have in mind, more precisely? Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: gnu.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 41445 Cc: ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 22 maj 2020 kl. 13.11 skrev Eli Zaretskii : > Is that the right place to save-match-data, though? Should we perhaps > do that where utf-8-hfs file names are encoded? What location did you have in mind, more precisely? From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 08:07:29 2020 Received: (at 41445) by debbugs.gnu.org; 22 May 2020 12:07:29 +0000 Received: from localhost ([127.0.0.1]:58238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6SX-000638-Fd for submit@debbugs.gnu.org; Fri, 22 May 2020 08:07:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6SV-00062t-GQ for 41445@debbugs.gnu.org; Fri, 22 May 2020 08:07:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45987) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc6SP-0007f8-As; Fri, 22 May 2020 08:07:21 -0400 Received: from [176.228.60.248] (port=4473 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jc6SO-0007la-KJ; Fri, 22 May 2020 08:07:21 -0400 Date: Fri, 22 May 2020 15:07:24 +0300 Message-Id: <83wo542mwz.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 22 May 2020 13:16:04 +0200) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 22 May 2020 13:16:04 +0200 > Cc: ture@turepalsson.se, 41445@debbugs.gnu.org > > 22 maj 2020 kl. 13.11 skrev Eli Zaretskii : > > > Is that the right place to save-match-data, though? Should we perhaps > > do that where utf-8-hfs file names are encoded? > > What location did you have in mind, more precisely? I think in ucs-normalize-hfs-nfd-post-read-conversion and ucs-normalize-hfs-nfd-pre-write-conversion. IOW, so that this only affects encoding and decoding macOS file names. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 08:21:12 2020 Received: (at 41445) by debbugs.gnu.org; 22 May 2020 12:21:12 +0000 Received: from localhost ([127.0.0.1]:58279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6fo-0006QI-L5 for submit@debbugs.gnu.org; Fri, 22 May 2020 08:21:12 -0400 Received: from mail173c50.megamailservers.eu ([91.136.10.183]:39938 helo=mail56c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6fl-0006Q6-09 for 41445@debbugs.gnu.org; Fri, 22 May 2020 08:21:11 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1590150067; bh=k5DuMtf530nzYvfYcVzUOmDpzBjJHFpafgVv3Uj+RsE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=spS0TeZ7XR/t2Kn2qVkmcVMvjpUTDhTcfIXp/Stj1hnAntZg4ZArxJMNiUonKdIE4 ys54lIshpGDFEa45+2L3DPgBadlA0rfMu9UE+iXI5mtlC3xUNDw1ccILf01lPhZng2 ArlFK8eho2VdEVTj4gGOB/DkHiS8qtM2SrNAWsks= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04MCL4LJ010925; Fri, 22 May 2020 12:21:06 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83wo542mwz.fsf@gnu.org> Date: Fri, 22 May 2020 14:21:04 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <1FF1F90B-CA25-487B-BF5A-EE16E43CF50B@acm.org> References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F22.5EC7C34F.0045: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=UqsdyN4B c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=mDV3o1hIAAAA:8 a=DxUQQQx8GRNb7lv8V7sA:9 a=CjuIK1q_8ugA:10 a=_FVE-zBwftR9WsbkzFJk:22 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 41445 Cc: =?utf-8?Q?Ture_P=C3=A5lsson?= , 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 22 maj 2020 kl. 14.07 skrev Eli Zaretskii : > I think in ucs-normalize-hfs-nfd-post-read-conversion and > ucs-normalize-hfs-nfd-pre-write-conversion. IOW, so that this only > affects encoding and decoding macOS file names. WDYT? Both of these call ucs-normalize-region, which makes it natural to save = match data in that function. Conversely, anything that calls = ucs-normalize-region would have to be wrapped, not just the two = functions you mentioned. In other words, there seems to be no advantage = in saving the match data in those functions, only disadvantages. From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 08:35:42 2020 Received: (at 41445) by debbugs.gnu.org; 22 May 2020 12:35:42 +0000 Received: from localhost ([127.0.0.1]:58329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6tq-0006pG-6X for submit@debbugs.gnu.org; Fri, 22 May 2020 08:35:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6to-0006p4-Jb for 41445@debbugs.gnu.org; Fri, 22 May 2020 08:35:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47290) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc6ti-0004uf-6I; Fri, 22 May 2020 08:35:34 -0400 Received: from [176.228.60.248] (port=2244 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jc6th-0002Sr-Mo; Fri, 22 May 2020 08:35:34 -0400 Date: Fri, 22 May 2020 15:35:38 +0300 Message-Id: <83pnaw2llx.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <1FF1F90B-CA25-487B-BF5A-EE16E43CF50B@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 22 May 2020 14:21:04 +0200) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <1FF1F90B-CA25-487B-BF5A-EE16E43CF50B@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 22 May 2020 14:21:04 +0200 > Cc: Ture Pålsson , 41445@debbugs.gnu.org > > 22 maj 2020 kl. 14.07 skrev Eli Zaretskii : > > > I think in ucs-normalize-hfs-nfd-post-read-conversion and > > ucs-normalize-hfs-nfd-pre-write-conversion. IOW, so that this only > > affects encoding and decoding macOS file names. WDYT? > > Both of these call ucs-normalize-region, which makes it natural to save match data in that function. Conversely, anything that calls ucs-normalize-region would have to be wrapped, not just the two functions you mentioned. In other words, there seems to be no advantage in saving the match data in those functions, only disadvantages. My line of reasoning was that only the callers of ENCODE_FILE and DECODE_FILE will not expect the match-data to be clobbered. Code that calls ucs-normalize-region directly may or may not be bothered by the clobbering, so we should leave that to the caller. The advantage of not doing this unconditionally is that we don't unnecessarily punishing callers that don't need match-data to be saved. From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 07:36:45 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 11:36:45 +0000 Received: from localhost ([127.0.0.1]:33529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcSSL-0001YP-4h for submit@debbugs.gnu.org; Sat, 23 May 2020 07:36:45 -0400 Received: from mail158c50.megamailservers.eu ([91.136.10.168]:44650 helo=mail51c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcSSI-0001YG-Or for 41445@debbugs.gnu.org; Sat, 23 May 2020 07:36:43 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1590233800; bh=FkF0gyJvKd8lO8eJJMRIsg3TNkE14pTnL6OpyBNHCLA=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=UxlBGztTq7ddIHvsX77cLNHQUBMEbHnGyya0mcg6C5nmsLwDl1tfnjOr/fgpGLp/m dSDcbZeqtwvDTKMIp9RJWZuJmEbD7TlXDM/BjawWS0B97j6CkL59JuMJ25oh+XHoN2 HaWUuyTzA3hx46WOdZzhDfUoxELBLm0uHt2160o0= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail51c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04NBabRE006317; Sat, 23 May 2020 11:36:39 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <83wo542mwz.fsf@gnu.org> Date: Sat, 23 May 2020 13:36:37 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F24.5EC90A6A.002D: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=MOMeZ/Rl c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=UoQy_O0IALNQMqpdxYEA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 41445 Cc: ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > My line of reasoning was that only the callers of ENCODE_FILE and > DECODE_FILE will not expect the match-data to be clobbered. Code that > calls ucs-normalize-region directly may or may not be bothered by the > clobbering, so we should leave that to the caller. >=20 > The advantage of not doing this unconditionally is that we don't > unnecessarily punishing callers that don't need match-data to be > saved. For callers of the ucs-normalize- functions, correctness should come = first; their names, semantics or descriptions do not lead the user to = suspect them of clobbering the match data. It is an implementation = leakage which can be quite unexpected, as is witnessed by this bug. For example, in one of the few calls I could find at all, this might be = classified as a near-miss, only saved by the left-to-right argument = evaluation order: (lookup-new-entry=20 'regular dictionary (match-string 0) (ucs-normalize-HFS-NFC-string (match-string 1)))) From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 08:28:46 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 12:28:46 +0000 Received: from localhost ([127.0.0.1]:33613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTGg-0004wo-JP for submit@debbugs.gnu.org; Sat, 23 May 2020 08:28:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTGf-0004wd-Hm for 41445@debbugs.gnu.org; Sat, 23 May 2020 08:28:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42429) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcTGY-0005W8-N7; Sat, 23 May 2020 08:28:38 -0400 Received: from [176.228.60.248] (port=3924 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jcTGX-0000kf-1v; Sat, 23 May 2020 08:28:37 -0400 Date: Sat, 23 May 2020 15:28:42 +0300 Message-Id: <83tv06zvgl.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier In-Reply-To: <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Sat, 23 May 2020 13:36:37 +0200) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Sat, 23 May 2020 13:36:37 +0200 > Cc: ture@turepalsson.se, 41445@debbugs.gnu.org > > > My line of reasoning was that only the callers of ENCODE_FILE and > > DECODE_FILE will not expect the match-data to be clobbered. Code that > > calls ucs-normalize-region directly may or may not be bothered by the > > clobbering, so we should leave that to the caller. > > > > The advantage of not doing this unconditionally is that we don't > > unnecessarily punishing callers that don't need match-data to be > > saved. > > For callers of the ucs-normalize- functions, correctness should come first; their names, semantics or descriptions do not lead the user to suspect them of clobbering the match data. It is an implementation leakage which can be quite unexpected, as is witnessed by this bug. I thought we had some advice to Lisp programs not to assume that match-data will be preserved, but maybe I'm misremembering. Stefan, do you remember something along these lines? Anyway, if you feel strongly about doing this on the lowest level, I won't fight. From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 08:37:36 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 12:37:36 +0000 Received: from localhost ([127.0.0.1]:33630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTPE-0005B1-KM for submit@debbugs.gnu.org; Sat, 23 May 2020 08:37:36 -0400 Received: from mail-oo1-f67.google.com ([209.85.161.67]:41030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTPD-0005Ao-9H for 41445@debbugs.gnu.org; Sat, 23 May 2020 08:37:35 -0400 Received: by mail-oo1-f67.google.com with SMTP id z26so2712174oog.8 for <41445@debbugs.gnu.org>; Sat, 23 May 2020 05:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ISb2KRGBD2EQbNlQtNj9s1Qsgg4Y7Rh0l9kA+nuLh3w=; b=IDA+/Tr02Syods97aUICl2jIVYMT994J5r4X0DOQ0j+1OIwKmlAF75LAv23VmU2n8D eh01yMmd5CJBUDWG1u2qNofr/VjIToZiXoQW5lC96YhgCQRFrFKIrrqvFnyyL4WBQuAl tq4uOMigawbiB03ldOqfH26WYdtU5CgtKcYmTkD6AmDJkKpd9OgtLTdi651dy5/YrKo4 f5veyzTmOlU/tnEM9ZAXV1fwy0hIQ9gHwgHlmumDENUuAu20IeHxZaPXLOcYI6XPBIvW MHL+K3zAB2tEBJkP6YsJq/B2BdHTDD14P90AFZXf795Ybv1o/FSieuOiD+8HbXgmN7L9 syeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ISb2KRGBD2EQbNlQtNj9s1Qsgg4Y7Rh0l9kA+nuLh3w=; b=RLQ1dpOI8UtJCaDEhgwkkn0EJ/gkYtYsU9viYdfm9tG8oINBVdHzkilTjhiW8GHjrC MFsVe73GiQ2UWBeLkVtiIP2amso44SDHLytQ69nptM8uzz9DY55LP33G1hLo+sJoNtFX o2YZut3924WfLf3/a/5LBHdsksqaHVq7AdL6wF2zio4YunX4ocJXuOOzKYdGyimMmojj s8/dXVt4fTxCGw6ji37SZ7g7UhjdkpR7N5mg+Zbd/j4cLKIq2OSyIM3g204j1cZ52ehF 9bjuQ798QhocQ7IdH9I1WSOMY/UZn6DmuRksBb4reVhW3/aNMAV9oIzbeBYoaSk33aoh fg3g== X-Gm-Message-State: AOAM530XyZ8oH47aBezmY40Sts/QMbgDnZN9R+kikNn2Xo4YcXGZ8mA/ ro6t4HBRAd9OBzPTcRXYETL1n5/WT3ThWOJKDpQ= X-Google-Smtp-Source: ABdhPJz+Phn8jiQp9jGpBnMcRc1OZH2owWmlpnZF5cP2PEqlwDS61KW4uKrbgvy4fD2VmdlA3CqsYDOT9BvNKvotxXk= X-Received: by 2002:a4a:3790:: with SMTP id r138mr6698082oor.81.1590237449525; Sat, 23 May 2020 05:37:29 -0700 (PDT) MIME-Version: 1.0 References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> In-Reply-To: <83tv06zvgl.fsf@gnu.org> From: Philipp Stephani Date: Sat, 23 May 2020 14:37:17 +0200 Message-ID: Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 41445 Cc: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= , ture@turepalsson.se, Stefan Monnier , 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Am Sa., 23. Mai 2020 um 14:29 Uhr schrieb Eli Zaretskii : > > > From: Mattias Engdeg=C3=A5rd > > Date: Sat, 23 May 2020 13:36:37 +0200 > > Cc: ture@turepalsson.se, 41445@debbugs.gnu.org > > > > > My line of reasoning was that only the callers of ENCODE_FILE and > > > DECODE_FILE will not expect the match-data to be clobbered. Code tha= t > > > calls ucs-normalize-region directly may or may not be bothered by the > > > clobbering, so we should leave that to the caller. > > > > > > The advantage of not doing this unconditionally is that we don't > > > unnecessarily punishing callers that don't need match-data to be > > > saved. > > > > For callers of the ucs-normalize- functions, correctness should come fi= rst; their names, semantics or descriptions do not lead the user to suspect= them of clobbering the match data. It is an implementation leakage which c= an be quite unexpected, as is witnessed by this bug. > > I thought we had some advice to Lisp programs not to assume that > match-data will be preserved, but maybe I'm misremembering. Stefan, > do you remember something along these lines? That's at least what the manual says (https://www.gnu.org/software/emacs/manual/html_node/elisp/Match-Data.html)= : "Notice that all functions are allowed to overwrite the match data unless they're explicitly documented not to do so." (Not that I like that statement, but it is current reality.) From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 09:07:07 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 13:07:07 +0000 Received: from localhost ([127.0.0.1]:33681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTrm-0005tD-VE for submit@debbugs.gnu.org; Sat, 23 May 2020 09:07:07 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTrl-0005sb-6r for 41445@debbugs.gnu.org; Sat, 23 May 2020 09:07:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42789) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcTrf-0003Ij-2J; Sat, 23 May 2020 09:06:59 -0400 Received: from [176.228.60.248] (port=2309 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jcTre-0001hg-5o; Sat, 23 May 2020 09:06:58 -0400 Date: Sat, 23 May 2020 16:07:05 +0300 Message-Id: <83r1vaztom.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-Reply-To: (message from Philipp Stephani on Sat, 23 May 2020 14:37:17 +0200) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: mattiase@acm.org, ture@turepalsson.se, monnier@iro.umontreal.ca, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Philipp Stephani > Date: Sat, 23 May 2020 14:37:17 +0200 > Cc: Mattias Engdegård , > Stefan Monnier , ture@turepalsson.se, 41445@debbugs.gnu.org > > > I thought we had some advice to Lisp programs not to assume that > > match-data will be preserved, but maybe I'm misremembering. Stefan, > > do you remember something along these lines? > > That's at least what the manual says > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Match-Data.html): > "Notice that all functions are allowed to overwrite the match data > unless they're explicitly documented not to do so." > (Not that I like that statement, but it is current reality.) Right, thanks. I missed that. From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 09:08:34 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 13:08:34 +0000 Received: from localhost ([127.0.0.1]:33686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTtC-0005vb-BS for submit@debbugs.gnu.org; Sat, 23 May 2020 09:08:34 -0400 Received: from mail1442c50.megamailservers.eu ([91.136.14.42]:50020 helo=mail264c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcTt9-0005vM-4q for 41445@debbugs.gnu.org; Sat, 23 May 2020 09:08:32 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1590239304; bh=j8f9ryeTdZBm3PVU5dMAx6ysI4L1bZoXqubmBTShEY4=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=mPL/TUc/M2nqk//Q0FaO8K7Ri20Xga3Hi+QOnQ1VFWb7viKX2q4anYOBzf5IbZ6VZ Mo9B9a99pA7aH9sAygKEv4parn8KibJxPLfgEK9Y0Z/ZaTeWBTITlKzh2+lQdlcOO6 B4ja2EErmzKNIsDcpO9HQd6ouP4hb7VvvLBf7ZYk= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail264c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04ND8LUW023061; Sat, 23 May 2020 13:08:22 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Sat, 23 May 2020 15:08:21 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> To: Philipp Stephani X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F16.5EC92048.004E: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=PPNxBsiC c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=pGLkceISAAAA:8 a=LVzYSr40S_3zAot_DUUA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 23 maj 2020 kl. 14.37 skrev Philipp Stephani : > "Notice that all functions are allowed to overwrite the match data > unless they're explicitly documented not to do so." > (Not that I like that statement, but it is current reality.) Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: megamailservers.eu] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.3 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 41445 Cc: Eli Zaretskii , ture@turepalsson.se, Stefan Monnier , 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 23 maj 2020 kl. 14.37 skrev Philipp Stephani : > "Notice that all functions are allowed to overwrite the match data > unless they're explicitly documented not to do so." > (Not that I like that statement, but it is current reality.) Thanks for the reference. Nevertheless, functions do use save-match-data = for the benefit of their callers every now and then. The practice is = fairly widespread, more so for functions that are otherwise = side-effect-free. It's a matter of reasonable expectation, not following = the manual to the letter. For that matter, there are few functions explicitly documented not to = clobber the match data, not counting the automatically inserted = statement for functions marked pure or side-effect-free. From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 09:36:13 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 13:36:13 +0000 Received: from localhost ([127.0.0.1]:33714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcUJw-0006cr-Og for submit@debbugs.gnu.org; Sat, 23 May 2020 09:36:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcUJu-0006cd-Pq for 41445@debbugs.gnu.org; Sat, 23 May 2020 09:36:11 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 26C044407E1; Sat, 23 May 2020 09:36:05 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2516C4407A5; Sat, 23 May 2020 09:36:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1590240964; bh=H9HtolCGLJBu44dCqxU5+78hUC+5PB6Lz1uiszC+xok=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KPc2ckBnvI+UOBSHspkV8EfDjKwo/KhTw+EbElrnfReLVQJVYeiWDOCVRa0xsQe4n +lbFR8Y9bI64UQZaveOnYgBQ1q2F4GnDwR9wU5xlKEQuHBaN3K4EKMeduvEQocSHTN fp8m5fy6JEgCFgWpDxVibgUy0XVEC66t5lbksPEjGdijnotdzE4nYsxxgKOlITn9GM hrRVKZnp779N2GznYMDxnxaKSq9SXzKRLrD3wIN1F/7c3FfhjeEXHoDRnjv/hg48WS YR7+rkPU204LRXWBzi8VcinVl5h3mfjduXslSJdB51dq0yFsiBgjuihpcKCyGB3dn4 M1kwCyBdWhGCQ== Received: from alfajor (unknown [216.154.27.250]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id ACECE1201F4; Sat, 23 May 2020 09:36:03 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." Message-ID: References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> Date: Sat, 23 May 2020 09:36:03 -0400 In-Reply-To: <83tv06zvgl.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 May 2020 15:28:42 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.098 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: Mattias =?windows-1252?Q?Engdeg=E5rd?= , ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > The advantage of not doing this unconditionally is that we don't >> > unnecessarily punishing callers that don't need match-data to be >> > saved. >> >> For callers of the ucs-normalize- functions, correctness should come >> first; their names, semantics or descriptions do not lead the user to >> suspect them of clobbering the match data. It is an implementation leakage >> which can be quite unexpected, as is witnessed by this bug. > > I thought we had some advice to Lisp programs not to assume that > match-data will be preserved, but maybe I'm misremembering. Stefan, > do you remember something along these lines? Right, we follow a convention where, by default, any function can clobber the match-data, with just some exceptions (typically, small/trivial functions). >From that point of view, I see no reason why ucs-normalize-* should be careful to preserve the match data. This said, *if* it is the case that many/most calls to a given function need to preserve the match-data around calls to it, it's of course OK to simply move the match-data-saving into that function, especially if that function's work dwarfs that of save-match-data. I just added the following to `save-match-data`'s docstring, to try and clarify: NOTE: The convention in Elisp is that any function, except for a few exceptions like car/assoc/+/goto-char, can clobber the match data, so `save-match-data' should normally be used to save *your* match data rather than your caller's match data. -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat May 23 11:45:57 2020 Received: (at 41445) by debbugs.gnu.org; 23 May 2020 15:45:57 +0000 Received: from localhost ([127.0.0.1]:35338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcWLV-00088b-Fr for submit@debbugs.gnu.org; Sat, 23 May 2020 11:45:57 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:55160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jcWLT-00088L-7h for 41445@debbugs.gnu.org; Sat, 23 May 2020 11:45:55 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04NFfYHx074062; Sat, 23 May 2020 15:45:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=IQlRyOSogKvXl2mqAQUlMMK/MDSeM+2/wQ4D781Qd9k=; b=osjC+46jmgASSdoeOriyAkERFpDTmg8MQOv40HRF3y7etX1DXhpgfAz/q7ajP3horYsB VGxofy9GA+PON2Zqp2u7PZGw81ljRhRfpHTCVpfpsBDFQGys8KjdXLuapKB5akHDOvO5 BwmjJHiGbMdwfYBGWY7cCQE23AAR4RnGpUSA+OeWxgRabmjNERm0DA9Gc4UTTAYg3VsF WUByw+MhFwUrJsETL1HuETOHe0qrlkwqJOjoj9x8ewIByMSa2JsrxSKeY5lxlFUr7xxF uhDJrO9FBYXzgEJpO1jXqZExY/9usxOVsP3N+606wuQX6dgnrHx3yiY5Lly+y0HVV9sl kA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 316vfn11nw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 23 May 2020 15:45:48 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04NFgcjw037971; Sat, 23 May 2020 15:43:47 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 316rxrtyky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 23 May 2020 15:43:47 +0000 Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04NFhXcE020214; Sat, 23 May 2020 15:43:34 GMT MIME-Version: 1.0 Message-ID: <08eb08ac-0ff0-424c-9885-271f36c6daa8@default> Date: Sat, 23 May 2020 08:43:33 -0700 (PDT) From: Drew Adams To: Stefan Monnier , Eli Zaretskii Subject: RE: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5005.0 (x86)] Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9629 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=944 phishscore=0 spamscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005230129 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9629 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 clxscore=1011 priorityscore=1501 mlxscore=0 malwarescore=0 spamscore=0 impostorscore=0 mlxlogscore=977 lowpriorityscore=0 bulkscore=0 adultscore=0 suspectscore=0 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005230129 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445 Cc: =?iso-8859-1?B?TWF0dGlhcyBFbmdkZWflcmQ=?= , ture@turepalsson.se, 41445@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > NOTE: The convention in Elisp is that any function, except for a > few exceptions like car/assoc/+/goto-char, can clobber the match > data, so `save-match-data' should normally be used to save *your*=20 > match data rather than your caller's match data. +1. I like that, especially the last phrase. Clear; important to get across. From debbugs-submit-bounces@debbugs.gnu.org Wed May 27 10:32:01 2020 Received: (at 41445-done) by debbugs.gnu.org; 27 May 2020 14:32:01 +0000 Received: from localhost ([127.0.0.1]:49742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdx69-00088l-09 for submit@debbugs.gnu.org; Wed, 27 May 2020 10:32:01 -0400 Received: from mail1434c50.megamailservers.eu ([91.136.14.34]:35502 helo=mail263c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdx62-00088Q-21 for 41445-done@debbugs.gnu.org; Wed, 27 May 2020 10:31:59 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1590589907; bh=rC93kTiMUcx0lo/JBs4wxRwDnYQyKC7/SzjMViawgJg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=duWRuuItWFYiM8jceAdDL6AA9/qZmcp5w8EY3TEsdeb8at8kddnAPHeo2eGJtlxLB HwPqiKbsWc9hiUKQ+G3zI2WPBX2MO63Qdym07QfCFMtGqDrP+uJUE6pPsi4V7g3bIE IfncMeXVTmP73BJYk7it2NCnJqz4aFEXW9lO7ZTs= Feedback-ID: mattiase@acm.or Received: from stanniol.lan (c-4e4ae655.032-75-73746f71.bbcust.telenor.se [85.230.74.78]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 04REVgnw031780; Wed, 27 May 2020 14:31:46 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: Date: Wed, 27 May 2020 16:31:42 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <833D7C13-F2B7-44D1-A16E-6385D0840657@acm.org> References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> To: Stefan Monnier X-Mailer: Apple Mail (2.3445.104.14) X-CTCH-RefID: str=0001.0A782F1C.5ECE798E.0059: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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=e6d4tph/ c=1 sm=1 tr=0 a=klNLuyVZdLUgl+K5Uafb2A==:117 a=klNLuyVZdLUgl+K5Uafb2A==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=iRZporoAAAAA:8 a=OKyNrclkV4Ob7-vJtV8A:9 a=CjuIK1q_8ugA:10 a=ENOmLqmOUNYA:10 a=NOBgFS-JBQ2l-kSd6-zu:22 X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 23 maj 2020 kl. 15.36 skrev Stefan Monnier : > From that point of view, I see no reason why ucs-normalize-* should be > careful to preserve the match data. Very well, since there appears to be a consensus for that view, I've pushed a change to the utf-8-hfs coding only. Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: umontreal.ca] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-Debbugs-Envelope-To: 41445-done Cc: Eli Zaretskii , =?utf-8?Q?Ture_P=C3=A5lsson?= , 41445-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 23 maj 2020 kl. 15.36 skrev Stefan Monnier : > =46rom that point of view, I see no reason why ucs-normalize-* should = be > careful to preserve the match data. Very well, since there appears to be a consensus for that view, I've = pushed a change to the utf-8-hfs coding only. From debbugs-submit-bounces@debbugs.gnu.org Wed May 27 11:55:10 2020 Received: (at 41445-done) by debbugs.gnu.org; 27 May 2020 15:55:10 +0000 Received: from localhost ([127.0.0.1]:49829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdyOc-0003tR-7a for submit@debbugs.gnu.org; Wed, 27 May 2020 11:55:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdyOa-0003t8-P8 for 41445-done@debbugs.gnu.org; Wed, 27 May 2020 11:55:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38728) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdyOT-00078b-GM; Wed, 27 May 2020 11:55:01 -0400 Received: from [176.228.60.248] (port=1039 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jdyOS-0008UL-Pz; Wed, 27 May 2020 11:55:01 -0400 Date: Wed, 27 May 2020 18:54:51 +0300 Message-Id: <83wo4xs790.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <833D7C13-F2B7-44D1-A16E-6385D0840657@acm.org> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Wed, 27 May 2020 16:31:42 +0200) Subject: Re: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." References: <83367s4427.fsf@gnu.org> <370FA0D9-1EF2-4EC4-977C-C20106CF222D@acm.org> <83wo542mwz.fsf@gnu.org> <76CFF420-CB1C-464A-A67C-22D813C00EB8@acm.org> <83tv06zvgl.fsf@gnu.org> <833D7C13-F2B7-44D1-A16E-6385D0840657@acm.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 41445-done Cc: ture@turepalsson.se, monnier@iro.umontreal.ca, 41445-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Feedback-ID:mattiase@acm.or > From: Mattias Engdegård > Date: Wed, 27 May 2020 16:31:42 +0200 > Cc: Eli Zaretskii , > Ture Pålsson , > 41445-done@debbugs.gnu.org > > 23 maj 2020 kl. 15.36 skrev Stefan Monnier : > > > From that point of view, I see no reason why ucs-normalize-* should be > > careful to preserve the match data. > > Very well, since there appears to be a consensus for that view, I've pushed a change to the utf-8-hfs coding only. Thanks. From unknown Mon Jun 23 07:52:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 25 Jun 2020 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator