From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: ture@turepalsson.se (Ture =?UTF-8?Q?P=C3=A5lsson?=) Newsgroups: gmane.emacs.bugs Subject: bug#41445: 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 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="117931"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ture@turepalsson.se To: 41445@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 22 07:56:31 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 1jc0fX-000UZY-Bn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 May 2020 07:56:31 +0200 Original-Received: from localhost ([::1]:55540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc0fV-0000xS-NY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 May 2020 01:56:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc0f5-0000xM-Gq for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 01:56:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jc0f5-0008Nc-7t for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 01:56:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jc0f4-0007Nx-64 for bug-gnu-emacs@gnu.org; Fri, 22 May 2020 01:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ture@turepalsson.se (Ture =?UTF-8?Q?P=C3=A5lsson?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 May 2020 05:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41445 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.159012693628355 (code B ref -1); Fri, 22 May 2020 05:56:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 May 2020 05:55:36 +0000 Original-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 Original-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 Original-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 Original-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 Original-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) Original-Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 03E4040012; Fri, 22 May 2020 07:23:42 +0200 (CEST) Original-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) Original-Received: by pommac.localdomain (Postfix, from userid 501) id 4EA45302E3CC9B; Fri, 22 May 2020 07:23:38 +0200 (CEST) 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-Mailman-Approved-At: Fri, 22 May 2020 01:55:32 -0400 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:180735 Archived-At: 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))