GNU bug report logs -
#46783
Catch mistaken (query-replace "a" "a")
Previous Next
Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Date: Thu, 25 Feb 2021 22:28:01 UTC
Severity: wishlist
Tags: notabug
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46783 in the body.
You can then email your comments to 46783 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Thu, 25 Feb 2021 22:28:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 25 Feb 2021 22:28:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
(query-replace "a" "a") should ask "Are you sure?"
Better yet: "Are you nuts?"...
So how could it happen?
Well, e.g.,
the user needs to replace some character with a similar character, all
through the document. So similar in fact that it is hard to tell the
difference.
Therefore emacs should be a good Samaritan and please "Refuse loudly to
do one big no-op that will make the user furious once he discovers he
meticulously did... *nothing at all*."
Imagine answering
ynnyynnnnnnyynynnnynyyyyynynyyyyyynnnnynnnynynynyny only to find out it was just a big
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn !
So emacs should simply double check the strings before starting.
No the user can't always tell, no matter how hard he looks, if they are
the same or not.
One might say "well there are still some uses for replacing the same
thing with itself." No, wrong.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Fri, 26 Feb 2021 08:58:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 46783 <at> debbugs.gnu.org (full text, mbox):
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:
> One might say "well there are still some uses for replacing the same
> thing with itself." No, wrong.
There is -- to remove text properties.
I'm not sure that's a compelling use case, though.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Fri, 26 Feb 2021 09:50:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 46783 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Fri, 26 Feb 2021 09:57:09 +0100, Lars Ingebrigtsen <larsi <at> gnus.org> said:
Lars> 積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:
>> One might say "well there are still some uses for replacing the same
>> thing with itself." No, wrong.
Lars> There is -- to remove text properties.
Lars> I'm not sure that's a compelling use case, though.
I find the following quite useful:
(require 'char-fold)
(setq replace-char-fold t)
C-x 8 RET e1 RET
(goto-char (point-min)
M-x query-replace RET a RET a
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Fri, 26 Feb 2021 16:00:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 46783 <at> debbugs.gnu.org (full text, mbox):
> > One might say "well there are still some uses for
> > replacing the same thing with itself." No, wrong.
>
> There is -- to remove text properties.
This.
It's also possible that someone wants to use
the query-replace dialog as a means of either
navigating or checking something at each
occurrence (e.g. looking at the context),
e.g., as an alternative to using Isearch or
`occur'.
Yes, there are other ways to accomplish such
aims, but each way to accomplish something
can have advantages and disadvantages.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Sat, 27 Feb 2021 04:16:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 46783 <at> debbugs.gnu.org (full text, mbox):
Robert Pluim <rpluim <at> gmail.com> writes:
> I find the following quite useful:
>
> (require 'char-fold)
> (setq replace-char-fold t)
> C-x 8 RET e1 RET
> (goto-char (point-min)
> M-x query-replace RET a RET a
Right. So there are at least two use cases for doing
(query-replace "a" "a"), so having `query-replace' query the user here
seems like it would be annoying.
So I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) notabug.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 27 Feb 2021 04:16:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
46783 <at> debbugs.gnu.org and 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 27 Feb 2021 04:16:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Sat, 27 Feb 2021 16:11:01 GMT)
Full text and
rfc822 format available.
Message #24 received at 46783 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> (query-replace "a" "a") should ask "Are you sure?"
> Better yet: "Are you nuts?"...
Emacs should not say such mean things to users.
It should follow the Kind Communication Guidelines.
It could say, "Are you serious?"
But that has a flaw: it fails to say what the concrete issue is. We
can't assume the user will figure this out from a vague expression of
doubt, whether kind or not. Emavs must inform per.
So it could say, "FROM-STRING and TO-STRING are identical -- are you serious?"
--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Sun, 28 Feb 2021 03:16:01 GMT)
Full text and
rfc822 format available.
Message #27 received at 46783 <at> debbugs.gnu.org (full text, mbox):
>>>>> "RMS" == Richard Stallman <rms <at> gnu.org> writes:
RMS> So it could say, "FROM-STRING and TO-STRING are identical -- are you serious?"
Excellent points.
And for those power users who really are always serious, there could be
a query-replace-skip-mental-health-check . Oops, I meant
query-replace-skip-identical-string-check,
or a dialog:
You have used identical strings for both FROM-STRING and TO-STRING.
Press:
b to blunder on ahead ("Don't question my logic. I have my reasons.")
! to blunder on ahead and remember this for the remainder of your days.
q to "quit while you are ahead."
x to always bomb out forever. No more late night cocktails.
d to launch the Emacs Eliza doctor program.
9 to call in a real doctor.
7 to show the Seven Signs of Senility checklist.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Sun, 28 Feb 2021 06:18:01 GMT)
Full text and
rfc822 format available.
Message #30 received at 46783 <at> debbugs.gnu.org (full text, mbox):
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> Press:
> b to blunder on ahead ("Don't question my logic. I have my reasons.")
> ! to blunder on ahead and remember this for the remainder of your days.
> q to "quit while you are ahead."
> x to always bomb out forever. No more late night cocktails.
> d to launch the Emacs Eliza doctor program.
> 9 to call in a real doctor.
> 7 to show the Seven Signs of Senility checklist.
Could you have this ready for release by April 1 -- with documentation?
--
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#46783
; Package
emacs
.
(Mon, 01 Mar 2021 03:53:02 GMT)
Full text and
rfc822 format available.
Message #33 received at 46783 <at> debbugs.gnu.org (full text, mbox):
>>>>> "RMS" == Richard Stallman <rms <at> gnu.org> writes:
RMS> Could you have this ready for release by April 1 -- with documentation?
Wait, don't forget EmacsCare™!
EmacsCare™, on by default, monitors the user's keystrokes 24 hours a day for
signs of OldTimersDisease. Holding down keys too long, saliva dribbling
on the keyboard, etc. will all notify caretakers to check on the
grandperson.
Keyboard navigation errors, and bad cognitive choices, like "trading
apples for apples" also calculate in one's final score. Sent to
caretakers every month.
Though there is no cure yet for OldTimersDisease, EmacsCare™ is ready
for the Baby Boomers now reaching their golden years and worse.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 29 Mar 2021 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 84 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.