From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#37095: [PATCH] Save match data in ucs-normalize-region Date: Fri, 23 Aug 2019 14:06:12 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <87k1b4sfni.fsf@mouse.gnus.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="6790"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: Akinori MUSHA , 37095@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 23 07:07:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i11n8-0001fI-AS for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2019 07:07:14 +0200 Original-Received: from localhost ([::1]:51424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i11n7-0002Mz-80 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Aug 2019 01:07:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43940) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i11mx-0002Mp-JB for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:07:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i11mw-0008DM-KJ for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i11mw-0008DF-HN for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i11mw-0000jc-BF for bug-gnu-emacs@gnu.org; Fri, 23 Aug 2019 01:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Aug 2019 05:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37095 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 37095-submit@debbugs.gnu.org id=B37095.15665367762750 (code B ref 37095); Fri, 23 Aug 2019 05:07:02 +0000 Original-Received: (at 37095) by debbugs.gnu.org; 23 Aug 2019 05:06:16 +0000 Original-Received: from localhost ([127.0.0.1]:38864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i11mB-0000iH-K8 for submit@debbugs.gnu.org; Fri, 23 Aug 2019 01:06:15 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:49847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i11m8-0000i7-Iv for 37095@debbugs.gnu.org; Fri, 23 Aug 2019 01:06:13 -0400 Original-Received: from mathent.math.s.chiba-u.ac.jp (mathent [192.168.32.5]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 461A2F0919; Fri, 23 Aug 2019 14:06:12 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: <87k1b4sfni.fsf@mouse.gnus.org> 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: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:165639 Archived-At: On Fri, 23 Aug 2019 12:51:29 +0900, Lars Ingebrigtsen wrote: > > Akinori MUSHA writes: > > > A patch generated by git format-patch is attached below, which simply > > wraps `ucs-normalize-region` with `save-match-data`. > > > > I'm a user of the Emacs Mac port by mituharu was investigating a bug > > where dired fails to open a certain local directory on macOS. The > > error was raised at `replace-match` in the `insert-directory` > > function: > > > > ``` > > (when (re-search-forward "^ *\\(total\\)" nil t) > > (let ((available (get-free-disk-space "."))) > > (when available > > ;; Replace "total" with "used", to avoid confusion. > > (replace-match "total used in directory" nil nil nil 1) > > ``` > > > > And it turned out the match data changed after returning from > > `get-free-disk-space` and that was why `replace-match` failed. > > You don't say what Emacs version you're reporting this bug for, but the > following patch was applied in February 2018 to the Emacs trunk, so I > think this problem has been fixed by now: For the Mac port, the "work" branch already contains a similar change: https://bitbucket.org/mituharu/emacs-mac/commits/b651c3a6bab6795202e2ebcd4396d665909cc210 It will shortly be included in the next release based on Emacs 26.3 RC1. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp