From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: A better UI than perform-replace Date: Thu, 19 Nov 2015 20:46:27 +0100 Message-ID: <87egfl6acs.fsf@fencepost.gnu.org> References: <56480D6C.2080408@yandex.ru> <876112xj2i.fsf@gmail.com> <87vb90yum7.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1447962425 7365 80.91.229.3 (19 Nov 2015 19:47:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Nov 2015 19:47:05 +0000 (UTC) Cc: Dmitry Gutov , emacs-devel , Oleh Krehel , Juri Linkov To: John Yates Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 19 20:46:50 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 1ZzVAB-0003Ac-RM for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2015 20:46:36 +0100 Original-Received: from localhost ([::1]:43775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzVAB-0008FA-C6 for ged-emacs-devel@m.gmane.org; Thu, 19 Nov 2015 14:46:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzVA7-0008Ch-3f for emacs-devel@gnu.org; Thu, 19 Nov 2015 14:46:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzVA6-0003m8-1k for emacs-devel@gnu.org; Thu, 19 Nov 2015 14:46:31 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzVA4-0003lf-Aw; Thu, 19 Nov 2015 14:46:28 -0500 Original-Received: from localhost ([127.0.0.1]:45492 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZzVA3-00014p-Of; Thu, 19 Nov 2015 14:46:27 -0500 Original-Received: by lola (Postfix, from userid 1000) id 52C0FDF5FD; Thu, 19 Nov 2015 20:46:27 +0100 (CET) In-Reply-To: (John Yates's message of "Thu, 19 Nov 2015 14:11:40 -0500") 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: 2001:4830:134:3::e 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:194817 Archived-At: John Yates writes: > On Thu, Nov 19, 2015 at 11:31 AM, John Wiegley wrote: > >> Wanting to use Emacs for other editing, while in the middle of a replace >> operation, is fairly expert also. We don't use a separate window with "F= ind >> Next" and "Replace" buttons, as graphical editors do: we use a modal >> prompt in >> the mini-buffer. Most Emacs users expect this to mean that they must >> complete >> their operation before Emacs is fully available again. >> > > Disclaimer: my model for the proposed interaction is query-replace. > If we are actually contemplating something quite different then > perhaps my comments are irrelevant. That said... > > The usage scenario is not uncommon and is not an instance of wanting > to perform arbitrary editing in the middle of a replace operation. > Rather it is a question of wanting (or needing) to clean-up alignment > _after_ replacing a token with a token of a different length. A very > common instance is ensuring that end of line comments start at a > specified column. > > IIUC when prompted as to whether I wish to replace the current token > the recursive edit approach requires that I: > > 1) type C-r to enter a recursive edit > 2) adjust whitespace (thereby corrupting the visible alignment > around the as yet un-replaced token) hoping that I properly > anticipate the whitespace needs that will obtain once the > replace actually occurs > 3) type C-M-c to exit recursive edit > 4) respond to the query-replace prompt > > Following 4) token replacement occurs and the display updates to > the next match. Wrong response to the query-replace prompt then. Type Space or =E2=80=98y=E2=80=99 to replace one match, Delete or =E2= =80=98n=E2=80=99 to skip to next, RET or =E2=80=98q=E2=80=99 to exit, Period to replace one match and exi= t, Comma to replace but not move point immediately, C-r to enter recursive edit (C-M-c to get out again), C-w to delete match and recursive edit, C-l to clear the screen, redisplay, and offer same replacement again, ! to replace all remaining matches in this buffer with no more question= s, ^ to move point back to previous match, E to edit the replacement string. In multi-buffer replacements type =E2=80=98Y=E2=80=99 to replace all re= maining matches in all remaining buffers with no more questions, =E2=80=98N=E2=80=99 to skip to the next buffer without replacing remain= ing matches in the current buffer. So you should have typed a comma. Or, once you consider yourself foiled, follow the "press ? for help" prompt and discover "^ to move point back to previous match". --=20 David Kastrup