From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chunyang Xu Newsgroups: gmane.emacs.devel Subject: Re: Interactive query-replace Date: Fri, 10 Feb 2017 12:38:30 +0800 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486701524 415 195.159.176.226 (10 Feb 2017 04:38:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2017 04:38:44 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 26.0.50.2 Cc: emacs-devel@gnu.org To: Ole Laursen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 10 05:38:39 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cc2yj-0008Aq-Cj for ged-emacs-devel@m.gmane.org; Fri, 10 Feb 2017 05:38:37 +0100 Original-Received: from localhost ([::1]:41731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cc2yp-0001xp-74 for ged-emacs-devel@m.gmane.org; Thu, 09 Feb 2017 23:38:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cc2yj-0001x2-Pj for emacs-devel@gnu.org; Thu, 09 Feb 2017 23:38:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cc2yg-00048P-Lf for emacs-devel@gnu.org; Thu, 09 Feb 2017 23:38:37 -0500 Original-Received: from smtpproxy19.qq.com ([184.105.206.84]:58898) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cc2yg-00047A-Cx for emacs-devel@gnu.org; Thu, 09 Feb 2017 23:38:34 -0500 X-QQ-mid: bizesmtp3t1486701508t44jjkj5v Original-Received: from Chunyangs-MacBook-Air.local (unknown [114.236.198.223]) by esmtp4.qq.com (ESMTP) with id ; Fri, 10 Feb 2017 12:38:27 +0800 (CST) X-QQ-SSF: 0110000000000050F410B00A0000000 X-QQ-FEAT: OthLD3hRvFEYADaCa2HyqilXLvp0fv88B/WXlfCViji+6HA/JO2AqPKPXbL1r wH+SO1mFNT+jPQNNLNN4Qs8/E0TDtzAyOHlbzafCL1JH9oFAUlSabKRD4L1HIGCYiZ2FBzb P5cSh8ToH0OP++r8KMAygQ8lvKo+/EFCtWVF6EtEj90tcq7E99O2rV7khX8wScJxi5DWEPT K3UO+yS6HWtgjyC80N29BxX9/ZWf9/LbGrZooAPGKUPilmVY80i+9 X-QQ-GoodBg: 0 In-reply-to: X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x [fuzzy] X-Received-From: 184.105.206.84 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:212194 Archived-At: Ole Laursen writes: > Hi! > > I realized the other day that search and replace in Emacs isn't very > interactive when a coworker showed me another editor he was > experimenting with. What he somehow did there seemed like something > Emacs would do when query-replacing, only it doesn't. > > Search and replace has three phases: > > - Enter search term > - Enter replacement term > - Confirmation > > Only confirmation is interactive in Emacs. > > The search phase could move the cursor and highlight all matches as > you type, just like isearch. Then we can see what we're about to > overwrite. > > Replacement text phase could overwrite each match visible in the > buffer with the replacement text as you type it. The replacements > would still be highlighted so it's obvious what's happening. Then we > can actually evaluate how the replacement works in practice in the > buffer before committing to it. > > Confirmation then actually commits the changes to the buffer, just like today. > > Doesn't this sound like something Emacs should be doing? > > I'll admit I have no idea how to actually implement it. > > > Ole