GNU bug report logs - #41445
26.3; Query-replace triggers "match data clobbered by..."

Previous Next

Package: emacs;

Reported by: ture <at> turepalsson.se (Ture Pålsson)

Date: Fri, 22 May 2020 05:56:01 UTC

Severity: normal

Tags: patch

Found in version 26.3

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mattias Engdegård <mattiase <at> acm.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, ture <at> turepalsson.se, Stefan Monnier <monnier <at> iro.umontreal.ca>, 41445 <at> debbugs.gnu.org
Subject: bug#41445: 26.3; Query-replace triggers "match data clobbered by..." 
Date: Sat, 23 May 2020 15:08:21 +0200
23 maj 2020 kl. 14.37 skrev Philipp Stephani <p.stephani2 <at> gmail.com>:

> "Notice that all functions are allowed to overwrite the match data
> unless they're explicitly documented not to do so."
> (Not that I like that statement, but it is current reality.)

Thanks for the reference. Nevertheless, functions do use save-match-data for the benefit of their callers every now and then. The practice is fairly widespread, more so for functions that are otherwise side-effect-free. It's a matter of reasonable expectation, not following the manual to the letter.

For that matter, there are few functions explicitly documented not to clobber the match data, not counting the automatically inserted statement for functions marked pure or side-effect-free.





This bug report was last modified 4 years and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.