[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#37095: [PATCH] Save match data in ucs-normalize-region
From: |
YAMAMOTO Mitsuharu |
Subject: |
bug#37095: [PATCH] Save match data in ucs-normalize-region |
Date: |
Fri, 23 Aug 2019 14:06:12 +0900 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/25.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
On Fri, 23 Aug 2019 12:51:29 +0900,
Lars Ingebrigtsen wrote:
>
> Akinori MUSHA <knu@iDaemons.org> 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