From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleh Krehel Newsgroups: gmane.emacs.devel Subject: A better UI than perform-replace (was: Rename refactoring, or something like that) Date: Mon, 16 Nov 2015 12:47:01 +0100 Message-ID: <876112xj2i.fsf@gmail.com> References: <56480D6C.2080408@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447712399 16406 80.91.229.3 (16 Nov 2015 22:19:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Nov 2015 22:19:59 +0000 (UTC) Cc: emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 16 23:19:53 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZyS7s-0002Nk-S4 for ged-emacs-devel@m.gmane.org; Mon, 16 Nov 2015 23:19:53 +0100 Original-Received: from localhost ([::1]:50628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyS7s-0003Pm-B1 for ged-emacs-devel@m.gmane.org; Mon, 16 Nov 2015 17:19:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyIFd-0000nW-EN for emacs-devel@gnu.org; Mon, 16 Nov 2015 06:47:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyIFa-00065S-7K for emacs-devel@gnu.org; Mon, 16 Nov 2015 06:47:13 -0500 Original-Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:37113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyIFa-00065K-0s for emacs-devel@gnu.org; Mon, 16 Nov 2015 06:47:10 -0500 Original-Received: by wmww144 with SMTP id w144so115194116wmw.0 for ; Mon, 16 Nov 2015 03:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ebf1e+n9AJSZpHKkAJGTE8IpumFrRyP1SikO3927g8o=; b=q9adB8EFMENx7khABxMHOJpMdBmLi8ayvcF4JNqBwMY6BMTMmSn2ZaErYrY7RQeCiW pZmKtbkW60QzVEcmVpibTYuwDELqOLpyicUSwl50X8ZOeeayvqT3G62cILRbWsvh4sQ9 Cj9O3uyY2a4MSG1QZ2cXZCjW0A3t/Fcq+Vkntm2iFwB9mYAIoBsqzYdXwS6PHhMV5SQF w1z8agOJTpqWMBFcrWZaKgXhuFTaE3UMlLZ0vj4w24zFZU3+Af2OjaVo/PAIxXRpX6V1 8f4Au1hPie3St3kEWULODyIzF1Wi5iOt07tNWhL7oZm8SCa4IJv7U5h2jN2gEajLCokT Lsug== X-Received: by 10.194.104.132 with SMTP id ge4mr35700939wjb.127.1447674429151; Mon, 16 Nov 2015 03:47:09 -0800 (PST) Original-Received: from firefly (dyn069045.nbw.tue.nl. [131.155.69.45]) by smtp.gmail.com with ESMTPSA id t126sm18165028wmd.18.2015.11.16.03.47.08 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Nov 2015 03:47:08 -0800 (PST) In-Reply-To: <56480D6C.2080408@yandex.ru> (Dmitry Gutov's message of "Sun, 15 Nov 2015 06:43:24 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194571 Archived-At: Dmitry Gutov writes: > 5. Feel hugely motivated, and write a better UI for all of that. I think a better UI for `perform-replace' is warranted. The current thing is very basic: - No good way to see how many matches there are. - No good way to get an overview of matches per buffer. - No good way to pause the replacement procedure. - No good way to undo a replacement. An idea to improve this would be with a permanent *replace* buffer, similar to `dired' or *Buffer List*. This buffer would be visible during the replacement operation, together with the actual buffers that contain the candidates. Here are some ideas for key bindings and the general interface: 0. The *replace* buffer would be organized in branches by buffer, just like *xref* is currently. 1. "y" would mark the current item for replacement, which corresponds to the current line in the *replace* buffer, and advance to the next line. 2. "n" would mark the current item for non-replacement, and advance to the next line. This is to distinguish the items for which no decision was made yet: they don't have a `y' or `n' mark. 3. "Y" would mark all items from the current one until the end of the current buffer branch. "N" would work in a similar way. 4. "c" could change the replacement text for a single item. The mark would change appropriately. 5. "C" could change the replacement text for all following items. 6. "x" would execute all requested changes. 7. "e" would launch an `ediff' session to review the changes that "x" would do. 8. After "x", the *replace* buffer stays behind until the user kills it. It should serve to review the changes. Possibly "u" could be used to revert a performed change for the current item. 9. "C-n", "C-p" and any other navigational commands should work as usual. Except changing the current item in *replace* should result in that item being displayed in its native buffer - exactly what "C-o" currently does in *xref*. To re-describe things in a shorter way, *replace* should be a staging area for the `perform-replace' operation. With the ability to quickly view and manipulate the separate replacements, the ability to defer it indefinitely, and the ability to finalize the operation with "x". I post this idea here for feedback. Maybe there's a better way to do this. Maybe there are ideas to further improve my *replace* proposal. Maybe there's a wish to have this functionality in the core. Maybe someone even wants to implement it right away (I can do it eventually, if there are no volunteers). Let me know. Oleh