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 baf331e 3/3: Rename replace-in-string to string-replace Date: Mon, 28 Sep 2020 17:42:38 +0200 Message-ID: References: <20200926222500.20662.9159@vcs0.savannah.gnu.org> <20200926222503.227F720441@vcs0.savannah.gnu.org> <87h7riw3ti.fsf@gnus.org> <9e0ee248-a276-4f6a-a29f-a8984a0cf6fa@default> 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="11691"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 28 17:44:13 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 1kMvK1-0002wb-At for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Sep 2020 17:44:13 +0200 Original-Received: from localhost ([::1]:40290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMvK0-0007TH-D1 for ged-emacs-devel@m.gmane-mx.org; Mon, 28 Sep 2020 11:44:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMvIb-0005xu-2Z for emacs-devel@gnu.org; Mon, 28 Sep 2020 11:42:45 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:45375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMvIZ-000088-5k for emacs-devel@gnu.org; Mon, 28 Sep 2020 11:42:44 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id x14so1841634wrl.12 for ; Mon, 28 Sep 2020 08:42:42 -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=L/CAjeAkmucT9dR5IpL12UlVZ7VXZIx54NwccXqfTCY=; b=avV248lN42N/WEEBE6TLBQxUIwkblqj8qtILytyWWC20dQ1EkTAiCQgBA8dPqt4Rai as4wxkbE5RYheKSiPKKtIrL1hbioXB9dRtQSDgQCT806EuBDPxnb3M3/3jN2fEWU+Krd qBDlupCEgG1WaGziL8N1UFFELMJfYaAk7OO+DIYymdVAzO0DlNDJmZX5O7LUs8w4cNP1 9nmaEOscmOq5VN8Dl6QAg07NcthINLNWmEsNPB+Xpd3+44HLeQIQxuaOmTaXx85Amyhg SFf4AJCizgFhAV7UTQlLt8ZcIq1N0cTHQ2g+r+Bzf/9Qa5W788g4SlHpG8os1yS7U9Ga MdMg== 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=L/CAjeAkmucT9dR5IpL12UlVZ7VXZIx54NwccXqfTCY=; b=AZMfIaMLrbgbZdook89qfODueqNiDy0DOoX352NndrV/YjoDugVrKUnFNGSlUdChhx vOSSIyGuIOR6i8ahSXlH0z9hPAkg6N6Sum3JN6WKob3EIlNGmkaJWdmRegER0BMkFApX iLNUTEJ99oxOiiwh6DlALIlM8ux0A5zDbJGXqX0ELPl5txSbeIlqtyOr9W4E+bXKQPoP f1+GM/TqkQKK1LiB9gFd2WtI83SO16r/hazsqzwytIxw2Q4ODwGPuq/9MA9UCp5OqNe7 a6+13WYOOGZRwhBbSjvllUy8HXbVqlkSWVD8o0MOmSfSejTnkdkOTbm/xjI4/XgLX60J KjeQ== X-Gm-Message-State: AOAM532dkvYtpICDmypzQLNs1EnSahBtahIY4OtTmoXVFMecIRvgWtmP m3lgjioBV+99M7CdOL0NCsoVh+PeEwE= X-Google-Smtp-Source: ABdhPJyTwl0PdHysF1sXrdU7cJsgXgMYQ6DVbO4wZZlIdafogBvHjAE8rmeBNTdSCKFYhxdIfQpYLQ== X-Received: by 2002:adf:e6c2:: with SMTP id y2mr2512748wrm.117.1601307760555; Mon, 28 Sep 2020 08:42:40 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:ec55:f484:fbc:8e04]) by smtp.gmail.com with ESMTPSA id v2sm2012644wrm.16.2020.09.28.08.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 08:42:39 -0700 (PDT) In-Reply-To: <9e0ee248-a276-4f6a-a29f-a8984a0cf6fa@default> (Drew Adams's message of "Mon, 28 Sep 2020 08:21:03 -0700 (PDT)") Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=rpluim@gmail.com; helo=mail-wr1-x42b.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:256609 Archived-At: >>>>> On Mon, 28 Sep 2020 08:21:03 -0700 (PDT), Drew Adams said: Drew> FWIW - two things to say here, one about the name Drew> `string-replace' and one, more general, about naming. Drew> 1. `replace-in-string' is pretty self-explanatory, Drew> certainly more so than `string-replace'. The latter Drew> makes you think that you're replacing one string with Drew> another (which you are) - but where? In a buffer? file? Drew> the region? Drew> `string-replace' suggests the same that `replace-string' Drew> suggests. And we already have `replace-string': Drew> "Replace occurrences of FROM-STRING with TO-STRING." Drew> Now we'll have `replace-string' and `string-replace'? Drew> Is that progress? Drew> IIUC, `replace-in-string' was rejected because of some Drew> incompatibility with XEmacs (name clash?). If so, Drew> that's too bad, as replacing something within a string Drew> is pretty clear from that name. And as the something Drew> isn't part in the name, it's pretty straightforward to Drew> guess that it's a substring that's being replaced. Yes, it=CA=BCs an unfortunate clash. Then again, how much XEmacs code still exists that depends on it? Drew> Both `replace-in-string' and `replace-regexp-in-string' Drew> are pretty clear. `string-replace' and Drew> `string-replace-regexp' not so much. I agree with this. However it seems some people are used to - type naming, hence the long discussion about prefixing functions. (I use helm, which doesn=CA=BCt care what order the subwords are in, presumably ivy/company etc don=CA=BCt either). Drew> Just sayin'. I don't really have a great alternative Drew> here. (`replace-substring'? `replace-within-string'? Drew> `replace-some-of-string'? `replace-string-substring'?) Drew> If `replace-in-string' is off limits for some reason Drew> then so be it - but too bad. I can offer: 'replace-string-in-string', which has the advantage of being very regular with regard to 'replace-regexp-in-string' (and with completion should not be very difficult to type). Robert --=20