bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#41445: 26.3; Query-replace triggers "match data clobbered by..."


From: Eli Zaretskii
Subject: bug#41445: 26.3; Query-replace triggers "match data clobbered by..."
Date: Fri, 22 May 2020 15:35:38 +0300

> From: Mattias Engdegård <mattiase@acm.org>
> Date: Fri, 22 May 2020 14:21:04 +0200
> Cc: Ture Pålsson <ture@turepalsson.se>, 41445@debbugs.gnu.org
> 
> 22 maj 2020 kl. 14.07 skrev Eli Zaretskii <eliz@gnu.org>:
> 
> > 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]