GNU bug report logs - #23078
24.5; Query-replace case insensitive - do not prompt for do-nothing replacements

Previous Next

Package: emacs;

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

Date: Mon, 21 Mar 2016 14:47:01 UTC

Severity: wishlist

Tags: wontfix

Found in version 24.5

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 23078 in the body.
You can then email your comments to 23078 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23078; Package emacs. (Mon, 21 Mar 2016 14:47:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ed Avis <eda <at> waniasset.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 21 Mar 2016 14:47:02 GMT) Full text and rfc822 format available.

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

From: Ed Avis <eda <at> waniasset.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 24.5; Query-replace case insensitive - do not prompt for do-nothing
 replacements
Date: Mon, 21 Mar 2016 14:46:10 +0000
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

M-x query-replace is case insensitive by default.  You may sometimes
want to replace a string with another differing only in case, for
example changing 'aaa' to 'Aaa'.  But query-replace prompts for all
cases where a case-insensitive match for 'aaa' is found, even those that
already equal the destination string.

Here are the keypresses starting from 'emacs -Q' to reproduce:

a a a RET A a a RET ESC O A ESC O A ESC % a a a RET
A a a RET y

I suggest that if the search and replacement strings differ only in
case, then Emacs should prompt only where there is a real choice to be
made.  When the match of 'Aaa' is highlighted it makes no difference
whether you answer y or n; so Emacs should not waste the user's time
asking.

This does mean that the matches highlighted by query-replace differ from
those you would find with a normal case insensitive search, in these
specific circumstances where the search and replacement strings differ
only in case.  I think that is a fair tradeoff.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/share/emacs/24.5/etc/DEBUG.


In GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.18.7)
 of 2016-02-03 on buildhw-05.phx2.fedoraproject.org
Configured using:
 `configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g
 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
 -m64 -mtune=generic' LDFLAGS=-Wl,-z,relro'

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_MESSAGES: en_GB.UTF-8
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading term/xterm...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Quit

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils xterm time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 73605 5714)
 (symbols 48 17645 0)
 (miscs 40 35 138)
 (strings 32 9016 4221)
 (string-bytes 1 247931)
 (vectors 16 7037)
 (vector-slots 8 341247 33284)
 (floats 8 66 407)
 (intervals 56 219 5)
 (buffers 960 11)
 (heap 1024 29894 2227))

Please ignore autogenerated disclaimer below this point.

This email is intended only for the person to whom it is addressed and may contain confidential information. Any retransmission, copying, disclosure or other use of, this information by persons other than the intended recipient is prohibited. If you received this email in error, please contact the sender and delete the material. This email is for information only and is not intended as an offer or solicitation for the purchase or sale of any financial instrument. Wadhwani Asset Management LLP is a Limited Liability Partnership registered in England (OC303168) with registered office at 40 Berkeley Square, 3rd Floor, London, W1J 5AL. It is authorised and regulated by the Financial Conduct Authority.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23078; Package emacs. (Thu, 12 May 2022 16:31:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ed Avis <eda <at> waniasset.com>
Cc: 23078 <at> debbugs.gnu.org
Subject: Re: bug#23078: 24.5; Query-replace case insensitive - do not prompt
 for do-nothing replacements
Date: Thu, 12 May 2022 18:30:49 +0200
Ed Avis <eda <at> waniasset.com> writes:

> M-x query-replace is case insensitive by default.  You may sometimes
> want to replace a string with another differing only in case, for
> example changing 'aaa' to 'Aaa'.  But query-replace prompts for all
> cases where a case-insensitive match for 'aaa' is found, even those that
> already equal the destination string.
>
> Here are the keypresses starting from 'emacs -Q' to reproduce:
>
> a a a RET A a a RET ESC O A ESC O A ESC % a a a RET
> A a a RET y
>
> I suggest that if the search and replacement strings differ only in
> case, then Emacs should prompt only where there is a real choice to be
> made.  When the match of 'Aaa' is highlighted it makes no difference
> whether you answer y or n; so Emacs should not waste the user's time
> asking.
>
> This does mean that the matches highlighted by query-replace differ from
> those you would find with a normal case insensitive search, in these
> specific circumstances where the search and replacement strings differ
> only in case.  I think that is a fair tradeoff.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I think this might be more confusing than anything else.  And just
because the default replacement has no changes, you can (for instance)
`E' out and type in something else for that specific match.

So I don't think this would be a good idea as the default interface, and
I don't think many people would want to modify a user option for
something like this, so I'm closing this bug report as a "wontfix".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 May 2022 16:32:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 23078 <at> debbugs.gnu.org and Ed Avis <eda <at> waniasset.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 12 May 2022 16:32:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 10 Jun 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 292 days ago.

Previous Next


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