bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14708: 24.2; query-replace-regexp when match and replacement are the


From: Ed Avis
Subject: 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@waniasset.com>

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]