[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Word Delimited Query Replace
From: |
Juri Linkov |
Subject: |
Re: Word Delimited Query Replace |
Date: |
Sat, 18 Oct 2008 22:52:45 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) |
>> 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/
Word Delimited Query Replace (was: read-regexp), Juri Linkov, 2008/10/18