From: Ihor Radchenko <yantar92@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65536@debbugs.gnu.org,
Jens Schmidt <jschmidt4gnu@vodafonemail.de>,
Stefan Kangas <stefankangas@gmail.com>
Subject: bug#65536: 30.0.50; replace-regexp-in-string documentation does not mention it saves match data
Date: Sat, 26 Aug 2023 06:24:55 +0000 [thread overview]
Message-ID: <87zg2e9v7s.fsf@localhost> (raw)
In-Reply-To: <83il92mj20.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> NOTE: The convention in Elisp is that any function, except for a few
>> exceptions like car/assoc/+/goto-char, can clobber the match data,
>> so ‘save-match-data’ should normally be used to save *your* match data
>> rather than your caller’s match data.
>>
>> The final decision is yours ...
>
> I think it's okay to leave things as they are.
I can share some experience from me dropping some `save-match-data' from
Org parser - I had to fight the consequences, as a lot of Org's own
code implicitly assumed that match data is saved, which caused huge
number of tests to fail. Fixing this was not fun, although I was able to
do it because that particular function had a history modifying match
data in the past and only relatively recent code additions were
affected.
If something like `replace-regexp-in-string' suddenly changes its
behaviour (even undocumented), I expect issues in third-party code.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-08-26 6:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-25 13:16 bug#65536: 30.0.50; replace-regexp-in-string documentation does not mention it saves match data Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-25 14:18 ` Eli Zaretskii
2023-08-25 15:26 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-25 16:56 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-26 6:09 ` Eli Zaretskii
2023-08-26 6:24 ` Ihor Radchenko [this message]
2023-08-26 8:40 ` Stefan Kangas
2023-08-26 9:09 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zg2e9v7s.fsf@localhost \
--to=yantar92@posteo.net \
--cc=65536@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=jschmidt4gnu@vodafonemail.de \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.