From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens Schmidt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 18:56:15 +0200 Message-ID: References: <837cpjnr2b.fsf@gnu.org> <8e1911a9-1944-c018-f108-fb34323b361f@vodafonemail.de> Reply-To: Jens Schmidt 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="27747"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Cc: 65536@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 25 18:57:10 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 1qZa7S-000711-Ex for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Aug 2023 18:57:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZa7H-0008R8-Mf; Fri, 25 Aug 2023 12:56:59 -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 1qZa7G-0008Qw-75 for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 12:56:58 -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 1qZa7F-00071b-Vs for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 12:56:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZa7K-0001Hm-Aw for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 12:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jens Schmidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2023 16:57:02 +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.16929826044911 (code B ref 65536); Fri, 25 Aug 2023 16:57:02 +0000 Original-Received: (at 65536) by debbugs.gnu.org; 25 Aug 2023 16:56:44 +0000 Original-Received: from localhost ([127.0.0.1]:41168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZa72-0001H8-1N for submit@debbugs.gnu.org; Fri, 25 Aug 2023 12:56:44 -0400 Original-Received: from mr4.vodafonemail.de ([145.253.228.164]:38308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZa6v-0001Gp-QH for 65536@debbugs.gnu.org; Fri, 25 Aug 2023 12:56:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-mb-mr2-21dec; t=1692982587; bh=kuSYbfu7D1hRlipBGfzVf9NBuWOgnpFHS8H3R6fzC8w=; h=Message-ID:Date:User-Agent:Subject:Content-Language:From:To: References:In-Reply-To:Content-Type:From; b=q2gdzJEztSo3js7hysG+VfxjMgH4f3pUJwo6Kmdr1L3sfda6oNySLdqEGBrWP6EwH 5s2StBPY4Shd+SvqrRCYUh92TF9wx8E5hPac8i3h+PIzqsw9LWgwSf+RKcXEqmzBx2 l9GBK1sZdCYXXjOXxhy/suTWt2h94lB7O1g9nzw8= Original-Received: from smtp.vodafone.de (unknown [10.0.0.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mr4.vodafonemail.de (Postfix) with ESMTPS id 4RXR1R4hqmz1y14; Fri, 25 Aug 2023 16:56:27 +0000 (UTC) Original-Received: from [192.168.0.138] (unknown [86.33.87.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 4RXR1J0DtCz9s4p; Fri, 25 Aug 2023 16:56:16 +0000 (UTC) Content-Language: de-DE-frami, en-US In-Reply-To: <8e1911a9-1944-c018-f108-fb34323b361f@vodafonemail.de> X-purgate-type: clean X-purgate: clean X-purgate-size: 1061 X-purgate-ID: 155817::1692982583-7B7FFE22-8FE41E1A/0/0 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:268444 Archived-At: On 2023-08-25 17:26, Jens Schmidt wrote: > On 2023-08-25 16:18, Eli Zaretskii wrote: >>> 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" > >>> 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? > > Not sure whether the following is convincing enough ... OTOH, I just found the following in the doc string of `save-match-data', which means that `replace-regexp-in-string' is actually not "convention-conforming": 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 ...