GNU bug report logs - #14708
24.2; query-replace-regexp when match and replacement are the same

Previous Next

Package: emacs;

Reported by: Ed Avis <eda <at> waniasset.com>

Date: Mon, 24 Jun 2013 15:52:05 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.2

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

Bug is archived. No further changes may be made.

Full log


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

From: Ed Avis <eda <at> waniasset.com>
To: 'Josh' <josh <at> foxtail.org>
Cc: "14708 <at> debbugs.gnu.org" <14708 <at> debbugs.gnu.org>
Subject: RE: bug#14708: 24.2; query-replace-regexp when match and
 replacement are the same
Date: Mon, 24 Jun 2013 16:30:46 +0000
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 <at> waniasset.com>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________




This bug report was last modified 11 years and 118 days ago.

Previous Next


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