unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Dmitry Gutov <dgutov@yandex.ru>, 35354@debbugs.gnu.org
Subject: 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)	[thread overview]
Message-ID: <a6b4cae3-c089-4bad-b41f-51d3336d1bdb@default> (raw)
In-Reply-To: <8f6f6e13-c150-a09f-06e5-aed3bfa21933@yandex.ru>

> > `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.





  reply	other threads:[~2019-04-21 23:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-21  3:20 bug#35354: 26.2; `dired-do-query-replace-regexp': How to replace only word-delimited matches? Drew Adams
2019-04-21 23:08 ` Dmitry Gutov
2019-04-21 23:57   ` Drew Adams [this message]
2019-04-22  9:24     ` Dmitry Gutov
2019-04-22 11:18       ` Drew Adams
2019-04-29 19:20     ` npostavs
2022-01-22 15:29       ` Lars Ingebrigtsen
2022-01-22 16:13         ` Drew Adams
2019-04-30  2:29 ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6b4cae3-c089-4bad-b41f-51d3336d1bdb@default \
    --to=drew.adams@oracle.com \
    --cc=35354@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).