From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <837cpjnr2b.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5092"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65536@debbugs.gnu.org To: Jens Schmidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 25 16:19:14 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qZXec-0000yF-Az for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Aug 2023 16:19:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZXeM-0000Up-LF; Fri, 25 Aug 2023 10:18:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZXeL-0000Uh-Fo for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 10:18:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZXeL-0004MO-7E for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 10:18:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZXeP-0005Ho-Pa for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 10:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2023 14:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65536 X-GNU-PR-Package: emacs Original-Received: via spool by 65536-submit@debbugs.gnu.org id=B65536.169297310120266 (code B ref 65536); Fri, 25 Aug 2023 14:19:01 +0000 Original-Received: (at 65536) by debbugs.gnu.org; 25 Aug 2023 14:18:21 +0000 Original-Received: from localhost ([127.0.0.1]:41024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZXdl-0005Gn-6G for submit@debbugs.gnu.org; Fri, 25 Aug 2023 10:18:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZXdk-0005GZ-8X for 65536@debbugs.gnu.org; Fri, 25 Aug 2023 10:18:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZXdZ-00042M-UZ; Fri, 25 Aug 2023 10:18:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=XUhP6lDGZ5MW1SfuNKjPfT6arivDN9xpcJ39I85bTVc=; b=IurAAsc7Z33dF6qIQ5ue netxALu3IZ1lXZ1zsjr4CWMdQsuaR2E0DOw6JjeAXsA4Iq4+lb/jHXNZcj/Hy5EwCtxZGteoFxCOc PEYALqY3YO+2WtX6A92kxXzNGGE3YxBn+7MS8xWegUSWbvZ/IzN6QR9uWYz/gZo8UoDD4a8WDDzRi yFP2yM3vmycD3+QpIQmAVGjxGk8lkr06T+fqpzDGMv56/thLyuwSgbYTPziZuw5wy56jMpmFxnOVc 4YHudTCGpJG9cYpAEr5PCi6L28TlnTY5OZo+JmkAMeDDZtGEkDsEtHh9jIzCUMz8o7BKhf3/xHOo7 s0gyu2ycI/qnBw==; In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268436 Archived-At: > 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" > > 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?