[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35354: 26.2; `dired-do-query-replace-regexp': How to replace only wo
From: |
npostavs |
Subject: |
bug#35354: 26.2; `dired-do-query-replace-regexp': How to replace only word-delimited matches? |
Date: |
Mon, 29 Apr 2019 15:20:43 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) |
>>>>> "Drew" == Drew Adams <drew.adams@oracle.com> writes:
>>>>> "Dmitry" == Dmitry Gutov <dgutov@yandex.ru> writes:
Drew> I was expecting that it would do all that the latter does plus
Drew> more.
Dmitry> I don't really understand how we can both expect FROM to be a
Dmitry> regexp and have a separate argument DELIMITED.
Drew> Why is that a problem?
It seems to give some possibly unexpected results. For example, with
this buffer contents:
word fooooo bar word
word foo bar word
C-u C-M-% foo.*bar RET replaces only the "foo bar" on the second line,
not the "fooooo bar" on the first line. That is to say, it's unclear
(to me at least) what DELIMITED means for regexps which can match both
word and non-word characters.
Drew> How does a user use `dired-do[-find]-query-replace-regexp' to replace
Drew> only word-delimited matches?
Dmitry> How about \<input\>?
Drew> How do you specify delimited _replacement_?
I understand how the match can be delimited, but I don't understand how
the replacement can be delimited.
Dmitry> Is there a practical difference between this and
Dmitry> using a regexp with word boundaries as FROM?
Drew> See `query-replace-regexp'. Why do you think it has argument
Drew> DELIMITED?
I think it might be just to save the user from typing `\<' and `\>'.
Did you have another reason in mind? If so, please say it plainly,
thanks.