GNU bug report logs - #35354
26.2; `dired-do-query-replace-regexp': How to replace only word-delimited matches?

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 21 Apr 2019 03:35:02 UTC

Severity: minor

Found in version 26.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 35354 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> gmail.com
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 35354 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: 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
>>>>> "Drew" == Drew Adams <drew.adams <at> oracle.com> writes:
>>>>> "Dmitry" == Dmitry Gutov <dgutov <at> 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.




This bug report was last modified 3 years and 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.