From: Ed Avis <eda@waniasset.com>
To: 'Josh' <josh@foxtail.org>
Cc: "14708@debbugs.gnu.org" <14708@debbugs.gnu.org>
Subject: bug#14708: 24.2; query-replace-regexp when match and replacement are the same
Date: Mon, 24 Jun 2013 16:30:46 +0000 [thread overview]
Message-ID: <7E039918541B4C4183BFDB8F015C74300E9459@WCL-EXCH02.wcl.local> (raw)
In-Reply-To: <CANdFEAEiog_AM7qyJ9i=nwCJdZ6K+ERtFLkKoEH2+1zHoOTSxA@mail.gmail.com>
Yes, I could have specified the regexp as ' +' instead of just ' +'.
That would not have given any cases where the match and replacement are the same.
I typed the regexp without too much thought, but it is not incorrect;
replacing one or more spaces with one space does what I want, just
with more replacement operations than are strictly necessary.
I think it would make Emacs more usable if it only prompted for replacements
which make a difference, after all, if the buffer contents will not be affected
one way or the other why waste the user's time asking for yes or no?
I do take your point that a no-op replacement can indicate a bug in
the regexp. Perhaps query-replace-regexp could print 'Skipping some
cases where matched text and replacement text are the same'.
--
Ed Avis <eda@waniasset.com>
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
next prev parent reply other threads:[~2013-06-24 16:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 11:44 bug#14708: 24.2; query-replace-regexp when match and replacement are the same Ed Avis
2013-06-24 16:19 ` Josh
2013-06-24 16:30 ` Ed Avis [this message]
2013-06-24 17:01 ` Andreas Schwab
2013-06-25 1:49 ` Stefan Monnier
2013-06-25 4:17 ` Josh Feinstein
2013-06-25 6:56 ` Ed Avis
2013-06-25 14:10 ` Drew Adams
2013-06-25 15:03 ` Josh
2013-06-25 13:39 ` Stefan Monnier
2013-06-25 14:59 ` Josh
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=7E039918541B4C4183BFDB8F015C74300E9459@WCL-EXCH02.wcl.local \
--to=eda@waniasset.com \
--cc=14708@debbugs.gnu.org \
--cc=josh@foxtail.org \
/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).