From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [RFC]: replace-region-contents Date: Sat, 02 Feb 2019 11:17:12 -0500 Message-ID: References: <871s4rqk7u.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="105441"; 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: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 03 16:07:49 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 1gqJN4-000RFQ-5A for ged-emacs-devel@m.gmane.org; Sun, 03 Feb 2019 16:07:46 +0100 Original-Received: from localhost ([127.0.0.1]:56649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqJN3-0006Fl-4j for ged-emacs-devel@m.gmane.org; Sun, 03 Feb 2019 10:07:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gqJLy-0006F8-GU for emacs-devel@gnu.org; Sun, 03 Feb 2019 10:06:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gqJLx-0001RA-QV for emacs-devel@gnu.org; Sun, 03 Feb 2019 10:06:38 -0500 Original-Received: from pmta31.teksavvy.com ([76.10.157.38]:15247) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1gqJLx-0001QX-MS; Sun, 03 Feb 2019 10:06:37 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GnAQA/A1dc/0Xhr2xkGgEBAQEBAgEBA?= =?us-ascii?q?QEHAgEBAQGBZQKCAoE3IRKIXIRHixIBggwTIgGZVA2EZgQCAoMRIzgSAQMBAQE?= =?us-ascii?q?BAQECAgJpKEIBEAGEdwEBAQECAVYjBQsLDiYSFBgNJIUvCKoHiiSMWIF/hCOKY?= =?us-ascii?q?QKJUoZagQSRQgmLE4dAijKIEptzDIFdIoFWMxoIMIMokHokgjmKUyqCIwEB?= X-IPAS-Result: =?us-ascii?q?A2GnAQA/A1dc/0Xhr2xkGgEBAQEBAgEBAQEHAgEBAQGBZQK?= =?us-ascii?q?CAoE3IRKIXIRHixIBggwTIgGZVA2EZgQCAoMRIzgSAQMBAQEBAQECAgJpKEIBE?= =?us-ascii?q?AGEdwEBAQECAVYjBQsLDiYSFBgNJIUvCKoHiiSMWIF/hCOKYQKJUoZagQSRQgm?= =?us-ascii?q?LE4dAijKIEptzDIFdIoFWMxoIMIMokHokgjmKUyqCIwEB?= X-IronPort-AV: E=Sophos;i="5.56,556,1539662400"; d="scan'208";a="65622525" Original-Received: from 108-175-225-69.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([108.175.225.69]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2019 10:06:35 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 12B14AE295; Sat, 2 Feb 2019 11:17:12 -0500 (EST) In-Reply-To: <871s4rqk7u.fsf@gnu.org> (Tassilo Horn's message of "Fri, 01 Feb 2019 22:20:37 +0100") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.38 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:232931 Archived-At: > (atomic-change-group Why? AFAICT only replace-buffer-contents modifies the buffer and it only does it atomically. > The current buffer is narrowed to the region between BEG and END, > then EXTRACT-FN is called in order to extract some value. > Thereafter, INJECT-FN is called with that value in a temporary > buffer which it should populate. Why 2 separate functions? Stefan PS: I wish replace-buffer-contents interpreted a string as the text to use as replacement rather than as a buffer name (which I find almost always to be a misfeature: better call `get-buffer` explicitly when we need to convert a string to a buffer). I think we should start by deprecating this "can be a buffer name" usage ASAP.