From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Keeping replace-buffer-contents runtime in bounds Date: Tue, 26 Feb 2019 07:51:57 +0100 Message-ID: <87zhqjdotu.fsf@gnu.org> References: <87r2c7ze9n.fsf@gnu.org> <83imxil8h6.fsf@gnu.org> <87y365a42g.fsf@gnu.org> <87k1hoidq6.fsf@gnu.org> <87o96zsjx0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="198148"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 26 07:52:47 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gyWbf-000pTK-DP for ged-emacs-devel@m.gmane.org; Tue, 26 Feb 2019 07:52:47 +0100 Original-Received: from localhost ([127.0.0.1]:50469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyWbe-00019q-BS for ged-emacs-devel@m.gmane.org; Tue, 26 Feb 2019 01:52:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyWb1-00019g-Ki for emacs-devel@gnu.org; Tue, 26 Feb 2019 01:52:08 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyWaw-0005W0-Dj; Tue, 26 Feb 2019 01:52:04 -0500 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:40155) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1gyWau-00068k-W5; Tue, 26 Feb 2019 01:52:02 -0500 Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id D064F20F02; Tue, 26 Feb 2019 01:51:59 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 26 Feb 2019 01:51:59 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrudekgddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecukfhppedufeegrdduudelrd dvgedrudelheenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhp rghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsug hhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigv pedt X-ME-Proxy: Original-Received: from jiffyarch (j289989.servers.jiffybox.net [134.119.24.195]) by mail.messagingengine.com (Postfix) with ESMTPA id D1FF710319; Tue, 26 Feb 2019 01:51:58 -0500 (EST) In-Reply-To: (Stefan Monnier's message of "Mon, 25 Feb 2019 16:03:53 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233626 Archived-At: Stefan Monnier writes: >> Well, after reading the docs for `interactive' again, I guess >> replace-region-contents could be a command with "X" interactive spec >> (and a check that the user actually typed in a function). Any >> objections? > > I don't see much point in making it a command. > Is there some actual use-case? I don't think that anybody would want to type in a lambda at the prompt but instead would simply create his own command using replace-region-contents. But I could see a use-case if REPLACE-FN could also just be a string or buffer instead of a function returning a string or a buffer. In that case, it could be used interactively like replace-buffer-contents but you could omit narrowing yourself. And a string wouldn't be interpreted as a buffer name but literally which would be handy in the case where you have the replacement already in your kill-ring. However, the interactive spec "B" makes it hard to enter a literal string because space is bound to word completion... Well, I guess that's not reason enough to make it interactive... Tassilo