From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: Word Delimited Query Replace
Date: Sat, 18 Oct 2008 22:08:55 -0400 [thread overview]
Message-ID: <jwvy70lz6k2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ljwlo6xc.fsf@jurta.org> (Juri Linkov's message of "Sun, 19 Oct 2008 02:29:19 +0300")
>>> Currently, M-s w is broken, and I'll will try to fix it. But even
>>> after it is fixed, I think it would be good to provide two ways to run
>>> word replacement from isearch, exactly as we already provide two ways
>>> to run regexp replacement:
>>> regexp search/replace: C-M-s M-% and C-s C-M-%
>>> word search/replace: M-s w M-% and C-s C-u M-%
>>
>> I'd rather discourage the second alternatives. After all, C-s C-M-% is
>> rather odd since it'll use the string you searched as a regexp, so if
>> you were searching for the string "a*b" the replacement will not apply
>> to what isearch matched.
> IMHO, it would be worse when the user habitually types C-u M-% to run
> word replacement or C-M-% to run regexp replacement and these keys do not
> do what the user wants.
They still do what the user wants outside of isearch. But the new
"query-replace from isearch" only works with M-% (which is one of the
advantages I see in this M-%: it provides the same featureset while
using fewer keys: the global M-% and C-M-% can be used for anything
else now).
As it happens, it seems that the problem you found is due to your
setting isearch-allow-scroll=t which caused the C-u to be eaten without
passing it to the query-replace, whereas with isearch-allow-scroll=nil
the C-u exits isearch and is then passed to query-replace correctly.
So I guess your change is OK: in the case that C-u is eaten by
isearch-allow-scroll=t, then the C-u will be passed on to query-replace,
and if it's not, then your change makes no difference and the C-u
exits isearch.
> We could provide these keys only as a back-up for the case we the user
> intuitively types it, and discourage them simply by not advertising in
> the documentation.
Yes, it's probably OK,
Stefan
next prev parent reply other threads:[~2008-10-19 2:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-18 12:41 read-regexp Eli Zaretskii
2008-10-18 16:19 ` read-regexp Juri Linkov
2008-10-18 19:13 ` read-regexp Stefan Monnier
2008-10-18 19:55 ` read-regexp Juri Linkov
2008-10-18 21:47 ` read-regexp Stefan Monnier
2008-10-18 23:29 ` read-regexp Juri Linkov
2008-10-18 19:21 ` read-regexp Eli Zaretskii
2008-10-18 19:59 ` read-regexp Juri Linkov
2008-10-18 16:23 ` Word Delimited Query Replace (was: read-regexp) Juri Linkov
2008-10-18 19:21 ` Word Delimited Query Replace Stefan Monnier
2008-10-18 19:52 ` Juri Linkov
2008-10-18 21:37 ` Stefan Monnier
2008-10-18 23:29 ` Juri Linkov
2008-10-19 2:08 ` Stefan Monnier [this message]
2008-10-19 22:48 ` Juri Linkov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy70lz6k2.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).