[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: A better UI than perform-replace

From: Drew Adams
Subject: RE: A better UI than perform-replace
Date: Thu, 19 Nov 2015 14:03:29 -0800 (PST)

> >   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".

Not to mention that the very first paragraph of `C-h k M-%' says:

Replace some occurrences of FROM-STRING with TO-STRING.
As each match is found, the user must type a character saying
what to do with it.  For directions, type C-h at that time.

And yes, newbies too (nay, newbies _especially_) should learn
first _how to ask Emacs_.  And having learned that, they should
_ask Emacs_ first.  It's really not complicated to ask Emacs
what `M-%' does: `C-h k M-%'.  And it should really not be hard
to see "For directions, type C-h" up front.  And if you do hit
`C-h' (or `?'), it should really not be hard to understand how
to replace without moving to the next search hit.

(But maybe the text should say "Comma (`,')..." instead of
"Comma...".  Oh, and each of the keys should be enclosed in
quotes, or else none of them should be, IMO.)

Every tutorial and intro to Emacs should start with a basic
lesson about how to _ask Emacs_.  (And every intermediate lesson
about Emacs should include deeper info about how to ask Emacs
about itself, including Elisp.)

I already agreed that an enhancement of `occur' along the
lines of what Oleh suggested should be a welcome addition.
But I disagree about it being difficult to understand or
discover the behavior of `query-replace' (`M-%') - assuming
that you've learned about `C-h k'.

And as David points out, even if you do not check `C-h k M-%',
the prompt itself tells you, over and over, that you can
"press `?' for help".  How someone could claim that the
behavior is difficult to discover is beyond me.  (But people
are different.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]