From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ole Laursen Newsgroups: gmane.emacs.devel Subject: Interactive query-replace Date: Thu, 9 Feb 2017 22:27:30 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1486675677 11923 195.159.176.226 (9 Feb 2017 21:27:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Feb 2017 21:27:57 +0000 (UTC) Cc: Ole Laursen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 09 22:27:54 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 1cbwFt-0002qn-Io for ged-emacs-devel@m.gmane.org; Thu, 09 Feb 2017 22:27:53 +0100 Original-Received: from localhost ([::1]:40284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbwFz-0007GW-CA for ged-emacs-devel@m.gmane.org; Thu, 09 Feb 2017 16:27:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbwFu-0007GO-7D for emacs-devel@gnu.org; Thu, 09 Feb 2017 16:27:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbwFt-0003Fw-HR for emacs-devel@gnu.org; Thu, 09 Feb 2017 16:27:54 -0500 Original-Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:35271) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cbwFt-0003Fo-C8 for emacs-devel@gnu.org; Thu, 09 Feb 2017 16:27:53 -0500 Original-Received: by mail-qk0-x236.google.com with SMTP id u25so19124938qki.2 for ; Thu, 09 Feb 2017 13:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iola-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to:cc; bh=hHQ1ilQJSaJt6sY2htPCIkiT05REhmXhB5Yg2tyQmqg=; b=Wlbc+Bhu7Z0v+Fgl6kAUh2hhS7eXQ7r3wY6ywW3yhswrHOtYT3IJHfSS+BHm+6mXks EaWcUBV94lcdGvAhnhrHdDFjfeZVFkxWVUJXdNmQkyDwqJIQ3YCktyFliNXFRyBYf8z9 Po6ZPvrYz7VX8ej0dMpA6gAAbA+YGPD4soJHgoGutp7qUMZV6znqcjwBUYyoPv1udrQG DRYyJOM3ieOrKmvCvJwT+jalqslPe/axyzce+6igiYGuF+h/lf4NRqeXYM2vFD3coGvL lQfjZX8AiMEK6eHtwU1osJCEpEhz3DmWX9heboHdKd3nx4pZl7IduG5oYRv0dtfI2Rth G+fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=hHQ1ilQJSaJt6sY2htPCIkiT05REhmXhB5Yg2tyQmqg=; b=bhEvMqNd6/zgPQS0xRNggd0cRuxz8ihuNXpibE95zyhxKZ/HrilDwylUfqUFHnMBas c59n7KHhirO6Ou8qNd7mpQxQq3FbrJywqM+fM7dj8qXcE2QHBH8sSg6xHrro9MeMVid/ SojZyp5C4mrksSpk2OhORZDkfE9/z9dJZIZ3D20oHfghUnilGLK7sSbpEtUPm9w9DCf7 1GcYXpT+oKwoewVN/BxltSHMUtKXM+EcimEW26haxwJvR8ShWs6hAk2CCURrXhkfQuzW NXx6o+pWvEewZCB1m4mTaH1VVA0nMj+wwBwFXNF+dCTHoknNCyZj2LURlWnbSz+2rDRB NpQQ== X-Gm-Message-State: AMke39nFP7Usm65hn4IjOZqC1tLEPBGv1lXP6g9IiBZrvXspjYxjE6E8YFr42WN5ptgtZUn52e+glYEw4v6HPA== X-Received: by 10.55.94.6 with SMTP id s6mr5496613qkb.166.1486675671122; Thu, 09 Feb 2017 13:27:51 -0800 (PST) Original-Received: by 10.12.138.23 with HTTP; Thu, 9 Feb 2017 13:27:30 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::236 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:212182 Archived-At: 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