From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: master 583cb26 2/3: Improve accuracy in string-replace description (bug#43598) Date: Mon, 28 Sep 2020 13:09:27 +0200 Message-ID: References: <20200927124520.25321.62354@vcs0.savannah.gnu.org> <20200927124522.BA20F207E0@vcs0.savannah.gnu.org> <9B45E488-F245-4A94-A492-C60B617A734B@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26131"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 28 13:10:47 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kMr3P-0006g0-EL for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Sep 2020 13:10:47 +0200 Original-Received: from localhost ([::1]:59854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMr3O-0004s6-GE for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Sep 2020 07:10:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMr2E-0004Ch-1q for emacs-devel@gnu.org; Mon, 28 Sep 2020 07:09:34 -0400 Original-Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:52340) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMr2C-000187-EM for emacs-devel@gnu.org; Mon, 28 Sep 2020 07:09:33 -0400 Original-Received: by mail-wm1-x32b.google.com with SMTP id q9so674314wmj.2 for ; Mon, 28 Sep 2020 04:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=A5m5y9O7o5qs0DN8zcQgVMFBxgd5HDMCO2o1FdkcuKM=; b=uFD9rocn90rz7cJV2injXWhqEiC3NlL6f7+QxjIhucWrnA8bcOi7VcYZb6aEUsUraU 8EOmdCtD2OhH2l/7PIi1FmZ5C6bpPeAZqhOSnbZ3KOvI8uEii1gRs0+Bu6ptXWWBTOh7 r8J71GgpA88AQ47ZoPuIZmms4xcYWJ3+PDg8m4/LLoF4HHTNSxlMGXRo71AoQpWQ98NL PgsWdG0Td+NF+ztQF2PFR/ddEIEDr4Z4+RRdOER+TuxcLBWNkxc5f1Cc1PSOZ1ZcJgq3 WhO7lZmLLiWD3P6qDhxyrayYTK64GOQPA7DWLWMBbqURaTFSN0OU1/znKPzORAIhulXt rj6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=A5m5y9O7o5qs0DN8zcQgVMFBxgd5HDMCO2o1FdkcuKM=; b=p7JLqCxdWPMx3Dyju7PJ5uXTpEwBjZaSi7IaZL46PdBRYSXeraELIGD0LSgnDHXI88 le0R6sPGPN/6Ck5kvZTYyJx0z+V0ftmUCPTKqYTUKBZCEmVGNq988tUjfh8jPWwcF6cN wc1pUSjKmXa9hdPthprV67wH7DyzdwgYeM5qclaDAPNvESw7h/vr8C3eFoJ93zyalCsb dwVEt4oT+jNFkkXGB55R0mklLZYeApe9sfFAcwMr8u0MJzbTTfkSEMG0WyifJfn4hyWD qkU1+VkYrxMlDMpTuxIzbpygZ8I4Xt1QIGVLl6uujHJw2Y71ByVXBCzzEAhE84/8IGDq hP5g== X-Gm-Message-State: AOAM531ybjRGm57m8AzNjeXomyCMmPLdasQ5eEF8qhgBOiyT2LjzRM2U 7tghaBN/X1SPySD/qqES/h7f/wsv2Tk= X-Google-Smtp-Source: ABdhPJx/AABAZ9V0et6HbuT4Mz3aUIxpkodEnHwoIYaWdLYkqo7OWc5++/4wRKnLR7f2Xqw4seN3ag== X-Received: by 2002:a1c:7d55:: with SMTP id y82mr1088638wmc.100.1601291369358; Mon, 28 Sep 2020 04:09:29 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:5e8:c9a6:d426:17be]) by smtp.gmail.com with ESMTPSA id u13sm914357wrm.77.2020.09.28.04.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 04:09:28 -0700 (PDT) In-Reply-To: <9B45E488-F245-4A94-A492-C60B617A734B@acm.org> ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Mon, 28 Sep 2020 11:59:43 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=rpluim@gmail.com; helo=mail-wm1-x32b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256585 Archived-At: >>>>> On Mon, 28 Sep 2020 11:59:43 +0200, Mattias Engdeg=C3=A5rd said: Mattias> 28 sep. 2020 kl. 11.42 skrev Robert Pluim : Mattias> @defun string-replace fromstring tostring instring Mattias> -This function copies @var{instring} and replaces any occurren= ces of Mattias> -@var{fromstring} with @var{tostring}. Mattias> +This function returns a string equal to @var{instring} where = any Mattias> +occurrences of @var{fromstring} have been replaced with Mattias> +@var{tostring}. It may return one of its arguments. Mattias> +Case is significant, and text properties are ignored. Mattias> @end defun >>=20 >> 'equal'? Really? And it=CA=BCs kind of passive-voicey. Mattias> Thank you for scrutinising my changes! Mattias> For technical documentation, a declarative or functional style= is Mattias> often appropriate than a procedural one. We would prefer defin= ing (+ A Mattias> B) as the sum of A and B instead of saying that it takes A, th= en adds Mattias> B, and finally returns the result. OK, but in this case the 'have been replaced' is less direct than it could be. >> How about: >>=20 >> This function replaces any occurences of @var{fromstring} with >> @var{tostring} in @var{instring} and returns the result. Mattias> That is probably fine. I wanted there to be no reason to Mattias> misread it as a mutation of INSTRING, but the risk is Mattias> probably minimal. I'll amend the text. Emacs documentation spoils me: destructive modification is called out explicitly when it can happen, which means I assume that if it=CA=BCs not mentioned, it can=CA=BCt happen. Robert --=20