all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: John Yates <john@yates-sheets.org>
Cc: Dmitry Gutov <dgutov@yandex.ru>,
	emacs-devel <emacs-devel@gnu.org>,
	Oleh Krehel <ohwoeowho@gmail.com>, Juri Linkov <juri@linkov.net>
Subject: Re: A better UI than perform-replace
Date: Thu, 19 Nov 2015 20:46:27 +0100	[thread overview]
Message-ID: <87egfl6acs.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CAJnXXoj62Y2ha+sp03vpXdq5JrZQ4fzHWkbBNee6_LyoymCdYw@mail.gmail.com> (John Yates's message of "Thu, 19 Nov 2015 14:11:40 -0500")

John Yates <john@yates-sheets.org> writes:

> On Thu, Nov 19, 2015 at 11:31 AM, John Wiegley <jwiegley@gmail.com> 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 "Find
>> 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 ‘y’ to replace one match, Delete or ‘n’ to skip to next,
    RET or ‘q’ to exit, Period to replace one match and exit,
    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 questions,
    ^ to move point back to previous match,
    E to edit the replacement string.
    In multi-buffer replacements type ‘Y’ to replace all remaining
    matches in all remaining buffers with no more questions,
    ‘N’ to skip to the next buffer without replacing remaining 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".

-- 
David Kastrup



  parent reply	other threads:[~2015-11-19 19:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-15  4:43 Rename refactoring, or something like that Dmitry Gutov
2015-11-16 10:03 ` joakim
2015-11-16 10:17   ` Dmitry Gutov
2015-11-16 11:47 ` A better UI than perform-replace (was: Rename refactoring, or something like that) Oleh Krehel
2015-11-16 18:01   ` A better UI than perform-replace Dmitry Gutov
2015-11-16 22:37   ` A better UI than perform-replace (was: Rename refactoring, or something like that) Drew Adams
2015-11-17 23:52     ` A better UI than perform-replace John Wiegley
2015-11-17 22:57   ` A better UI than perform-replace (was: Rename refactoring, or something like that) Richard Stallman
2015-11-18  0:55   ` A better UI than perform-replace Juri Linkov
2015-11-18  1:40     ` Drew Adams
2015-11-18 12:32     ` Dmitry Gutov
2015-11-19  0:57       ` Juri Linkov
2015-11-19  1:16         ` Dmitry Gutov
2015-11-20  0:40           ` Juri Linkov
2015-11-21 18:23             ` Dmitry Gutov
2015-11-19 12:46     ` John Yates
2015-11-19 16:31       ` John Wiegley
2015-11-19 19:11         ` John Yates
2015-11-19 19:18           ` John Wiegley
2015-11-20  8:06             ` Adrian.B.Robert
2015-11-19 19:46           ` David Kastrup [this message]
2015-11-19 22:03             ` Drew Adams
2015-11-20  0:42               ` Juri Linkov
2015-11-20  8:12                 ` Eli Zaretskii
2015-11-18  8:50   ` Andreas Schwab
2015-11-21  1:41   ` Eric Ludlam
2015-11-16 13:13 ` Rename refactoring, or something like that Óscar Fuentes
2015-11-16 20:53   ` Dmitry Gutov
2015-11-17 11:10     ` John Yates
2015-11-17 13:14       ` Dmitry Gutov
2015-11-17 15:57         ` John Yates
2015-11-16 16:01 ` Eli Zaretskii
2015-11-16 16:03   ` Dmitry Gutov
2015-11-16 17:18     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egfl6acs.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=john@yates-sheets.org \
    --cc=juri@linkov.net \
    --cc=ohwoeowho@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.