unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Cc: 65536@debbugs.gnu.org
Subject: bug#65536: 30.0.50; replace-regexp-in-string documentation does not mention it saves match data
Date: Fri, 25 Aug 2023 17:18:36 +0300	[thread overview]
Message-ID: <837cpjnr2b.fsf@gnu.org> (raw)
In-Reply-To: <ae9d72ec-9fea-5d4b-a56a-60244543108a@vodafonemail.de> (bug-gnu-emacs@gnu.org)

> Date: Fri, 25 Aug 2023 15:16:29 +0200
> From:  Jens Schmidt via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Not sure about this one, maybe I have overlooked something ...
> 
> The Emacs Lisp manual says:
> 
>    Notice that all functions are allowed to overwrite the match data
>    unless they’re explicitly documented not to do so.
> 
> And in particular function `replace-regexp-in-string' could be
> assumed to modify the match data, but it uses an explicit call to
> `save-match-data' to not do so.
> 
> Maybe this should be explicitly documented in its doc string and/or
> the Emacs Lisp manual ((elisp) Search and Replace) so that users of
> the function can rely on that fact?

Is it important to promise never to clobber match-data in this
function?





  reply	other threads:[~2023-08-25 14:18 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 [this message]
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
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837cpjnr2b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=65536@debbugs.gnu.org \
    --cc=jschmidt4gnu@vodafonemail.de \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).