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

From: Ed Avis <eda <at> waniasset.com>
To: "'jlf <at> foxtail.org'" <jlf <at> foxtail.org>, "'monnier <at> iro.umontreal.ca'"
 <monnier <at> iro.umontreal.ca>
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: Tue, 25 Jun 2013 06:56:07 +0000
I wouldn't say that the regexp in this case is broken - only suboptimal. The user entered something correct, to replace all sequences of spaces by a single space. If done as a global replace without confirmation, you wouldn't even notice. The user asked for confirmation of each change to end up with the right text in the buffer, not as an academic exercise in finding the best possible regexp.

So prompting for each no-op match is not really helping the user. I can see that sometimes you might use query-replace-regexp as a debugging aid (though surely a simple search without replacement would be better). But even then it would be enough just to flag up one case where match=replacement, not request y or n for each one, since they are all identical. (Here I am assuming no capturing groups.)

So maybe the answer is to flag the first no-op match but then skip the rest. 

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