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: Mattias Engdegård
Subject: bug#41445: 26.3; Query-replace triggers "match data clobbered by..."
Date: Sat, 23 May 2020 13:36:37 +0200

> 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.

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 
                 'regular dictionary (match-string 0)
                 (ucs-normalize-HFS-NFC-string (match-string 1))))







reply via email to

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