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.devel Subject: Re: Curious: Why is there no binding for replace-string "out of the box"? Date: Thu, 07 Mar 2024 09:15:52 +0200 Message-ID: <86il1yjyvr.fsf@gnu.org> References: <87frx36myt.fsf@igel.home> 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="3512"; mail-complaints-to="usenet@ciao.gmane.io" Cc: raman@google.com, schwab@linux-m68k.org, emacs-devel@gnu.org To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 07 08:17:06 2024 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 1ri801-0000f5-Sk for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Mar 2024 08:17:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ri7zC-00013V-UQ; Thu, 07 Mar 2024 02:16:15 -0500 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 1ri7z5-00010t-9j for emacs-devel@gnu.org; Thu, 07 Mar 2024 02:16:09 -0500 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 1ri7z4-0005f4-17; Thu, 07 Mar 2024 02:16:06 -0500 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=vEmaHJCfyOUSWAo/ZTgzPrTa2x6BxEND7NjPrpvEwAc=; b=gJOCpn3w8mjF9LmZWeTf U45AkOvxT1zxaH/v6fPrJCAy4DBjnEIRyZv8+QCxFPR0+94LtoAsUh8ltcByNNvor8MKCqm0PV9va zG7aRb2Xm4FsbYqGMgOKs1ynYLJPTbPvQvMAi4tQddHHspjgniHeIAYa4GTun+SZg9Klr8//Ka57p EhEBEwMli1RQD0MbXqF9lqwvLbzao1bwWJQUdEJYxSvIX5OfCNx6mFIQUNZ6k7Eld8wEfeFtay7Th iXfm4dxIUIIk/Phenv6OY4UnCtfctcBK3YVOB+tj75XvvmkgrUw4JQ8fw7/ISOCebeNAx6J7KvOE5 OBui3CL6cnP7/w==; In-Reply-To: (message from Yuri Khan on Thu, 7 Mar 2024 13:17:42 +0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316875 Archived-At: > From: Yuri Khan > Date: Thu, 7 Mar 2024 13:17:42 +0700 > Cc: Andreas Schwab , emacs-devel@gnu.org > > The user-facing difference between replace-string and query-replace is > that the former replaces unconditionally while the latter asks for > confirmation (with a possibility to type ‘!’ to confirm replacement > for all remaining occurrences). Similarly, replace-regexp vs > query-replace-regexp. > > Both confirming commands are bound by default: query-replace to M-%, > query-replace-regexp to C-M-%. > > Replacing without confirmation could be seen as an advanced feature — > if you are already comfortable with undo, you’re ready to use it; if > not, it’s scary. All it takes to make unconditional replacements is to type '!' once. TBH, I fail to see how that single keystroke could be significant when what you gain is a much more powerful command. Users can always bind replace-string to a key if they want, but allocating a key binding to it by default would be unwise, given how scarce the free keys are. So I don't think we should do that by default.