unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: npostavs@gmail.com
To: Drew Adams <drew.adams@oracle.com>
Cc: 35354@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
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	[thread overview]
Message-ID: <85d0l4mxdg.fsf@gmail.com> (raw)
In-Reply-To: <a6b4cae3-c089-4bad-b41f-51d3336d1bdb@default> (Drew Adams's message of "Sun, 21 Apr 2019 16:57:57 -0700 (PDT)")

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





  parent reply	other threads:[~2019-04-29 19:20 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
2019-04-22  9:24     ` Dmitry Gutov
2019-04-22 11:18       ` Drew Adams
2019-04-29 19:20     ` npostavs [this message]
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=85d0l4mxdg.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=35354@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=drew.adams@oracle.com \
    /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).