From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Word Delimited Query Replace
Date: Sat, 18 Oct 2008 22:52:45 +0300 [thread overview]
Message-ID: <87tzb9sn9m.fsf@jurta.org> (raw)
In-Reply-To: <jwvvdvpogwr.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 18 Oct 2008 15:21:58 -0400")
>> BTW, I discovered a UI problem: to prepare the patch it was necessary
>> to rename the string "default" but not its plural form "defaults" in
>> read-regexp. So I selected the region around the body of read-regexp
>> and typed `C-s default C-u M-%'. The C-u prefix argument of query-replace
>> means to replace only matches surrounded by word boundaries, but while
>> implementing isearch-query-replace a few years ago we missed this case,
>> so currently isearch-query-replace just ignores it.
>
> IIUC the right way to do it is to use M-s w during the search to toggle
> isearch-word, after which M-% should DTRT (just like M-% in regexp
> isearch requests a query-replace-regexp).
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-%
> Also, are you sure your patch works? As far as I can tell, C-u
> currently leaves isearch, and I don't see anything in your patch that
> would change it.
I have isearch-allow-scroll=t, and it allows C-u to not leave isearch.
Perhaps this should be the default behavior.
--
Juri Linkov
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2008-10-18 19:52 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 [this message]
2008-10-18 21:37 ` Stefan Monnier
2008-10-18 23:29 ` Juri Linkov
2008-10-19 2:08 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tzb9sn9m.fsf@jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.