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 #11 received at 35354 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, 35354 <at> debbugs.gnu.org
Subject: RE: bug#35354: 26.2; `dired-do-query-replace-regexp': How to replace
 only word-delimited matches?
Date: Sun, 21 Apr 2019 16:57:57 -0700 (PDT)
> > `dired-do-query-replace-regexp' has taken the key binding of
> > `dired-do-find-regexp-and-replace'.

(I obviously said that backward.  The latter took the
binding of the former.)

> > I was expecting that it would do
> > all that the latter does plus more.
> 
> I don't really understand how we can both expect FROM
> to be a regexp and have a separate argument DELIMITED.

Why is that a problem?

That's exactly what `dired-do-query-replace-regexp' does.
Its FROM is a REGEXP.  Doc string:

 Do ‘query-replace-regexp’ of FROM with TO, on all marked files.
 Third arg DELIMITED (prefix arg) means replace only
 word-delimited matches.
 If you exit (C-g, RET or q), you can resume the query replace
 with the command M-x tags-loop-continue.

(Of course, before the loss of key bindings, the last line
read simply "with the command M-,.)

> > How does a user use `dired-do-query-replace-regexp' to
> > replace only word-delimited matches?

(Again, I meant `dired-do-find-regexp-and-replace'.)

> How about \<input\>?

How do you specify delimited _replacement_?  It's about
the 3rd element returned by `query-replace-read-args',
which you're not currently using anywhere (even though
it is provided).

It's no different than it is for `query-replace-regexp'
or other commands that use `query-replace-read-args'.
But `xref-query-replace-in-results' doesn't accept that
3rd element, DELIMITED.  This bug report asks it to do so.

Also, args FROM and TO for `xref-query-replace-in-results'
aren't even described in its doc string.  They should be.

The doc string of `dired-do-query-replace-regexp' refers
to `query-replace-regexp', so users can tell that FROM is
in fact a REGEXP.  They deserve similar help for
`xref-query-replace-in-results', no?

`dired-do-query-replace-regexp' lets you use a prefix arg
to specify word-delimiting.  A prefix arg isn't even used
for `dired-do-find-regexp-and-replace'.  It would be simple
to do the same, provided `xref-query-replace-in-results'
could handle the DELIMITED arg.




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.