From unknown Wed Aug 20 05:16:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23078: 24.5; Query-replace case insensitive - do not prompt for do-nothing replacements Resent-From: Ed Avis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Mar 2016 14:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23078 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23078@debbugs.gnu.org X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.145857159726351 (code B ref -1); Mon, 21 Mar 2016 14:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Mar 2016 14:46:37 +0000 Received: from localhost ([127.0.0.1]:57055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ai16L-0006qw-A9 for submit@debbugs.gnu.org; Mon, 21 Mar 2016 10:46:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ai16I-0006qi-9m for submit@debbugs.gnu.org; Mon, 21 Mar 2016 10:46:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai169-0000BH-QO for submit@debbugs.gnu.org; Mon, 21 Mar 2016 10:46:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai169-0000BD-Nm for submit@debbugs.gnu.org; Mon, 21 Mar 2016 10:46:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai163-0006Xo-CQ for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 10:46:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai160-0000AD-1n for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 10:46:19 -0400 Received: from mail1.bemta14.messagelabs.com ([193.109.254.105]:5159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai15z-00009e-PB for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2016 10:46:15 -0400 Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id 2E/DC-02901-43900F65; Mon, 21 Mar 2016 14:46:12 +0000 X-Env-Sender: eda@waniasset.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1458571571!32836730!1 X-Originating-IP: [80.169.169.167] X-StarScan-Received: X-StarScan-Version: 8.11; banners=waniasset.com,-,- X-VirusChecked: Checked Received: (qmail 60784 invoked from network); 21 Mar 2016 14:46:11 -0000 Received: from unknown (HELO WCL-EXCHCAS02.wcl.local) (80.169.169.167) by server-15.tower-27.messagelabs.com with AES128-SHA encrypted SMTP; 21 Mar 2016 14:46:11 -0000 Received: from WCL-EXCH02.wcl.local ([169.254.1.105]) by WCL-EXCHCAS02.wcl.local ([149.85.127.102]) with mapi id 14.03.0279.002; Mon, 21 Mar 2016 14:46:11 +0000 From: Ed Avis Thread-Topic: 24.5; Query-replace case insensitive - do not prompt for do-nothing replacements Thread-Index: AdGDgF3gXEJquyyMQiGFiX9j5jJWSw== Date: Mon, 21 Mar 2016 14:46:10 +0000 Message-ID: <7E039918541B4C4183BFDB8F015C7430C4BBF9AB@WCL-EXCH02.wcl.local> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [149.85.127.151] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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=3Dx86_64-redhat-linux-gnu --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64 --libexecdir=3D/usr/libexec --localstatedir=3D/var --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png= --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3 --with-gpm=3Dno build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector-strong --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric' LDFLAGS=3D-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 reci= pient is prohibited. If you received this email in error, please contact t= he 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 an= y financial instrument. Wadhwani Asset Management LLP is a Limited Liabili= ty Partnership registered in England (OC303168) with registered office at = 40 Berkeley Square, 3rd Floor, London, W1J 5AL. It is authorised and regul= ated by the Financial Conduct Authority. From unknown Wed Aug 20 05:16:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23078: 24.5; Query-replace case insensitive - do not prompt for do-nothing replacements Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 May 2022 16:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23078 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Ed Avis Cc: 23078@debbugs.gnu.org Received: via spool by 23078-submit@debbugs.gnu.org id=B23078.16523730601875 (code B ref 23078); Thu, 12 May 2022 16:31:02 +0000 Received: (at 23078) by debbugs.gnu.org; 12 May 2022 16:31:00 +0000 Received: from localhost ([127.0.0.1]:42074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npBiO-0000Tm-3Q for submit@debbugs.gnu.org; Thu, 12 May 2022 12:31:00 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npBiM-0000NV-Ps for 23078@debbugs.gnu.org; Thu, 12 May 2022 12:30:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QsB9tJWnaBg1DObxHVqOdk+YsZdeOKUSvs2/HMfiiT8=; b=D+QzvY2Tol7ng3hNj0eaG8nHyK Xw95QAgacjGvLDqklgajHWilNqfpYEoXY4PdcbdSYt7oHf63JYL400ODU+cIN2MADy0IiFzaKVTQQ G3QwVmwx6tUPH+putLoRHpbkYPSyHZ4yfDWO0sM1QWVoXDIbEShayyXgFMnAl1B6tayM=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npBiE-0006um-48; Thu, 12 May 2022 18:30:52 +0200 From: Lars Ingebrigtsen References: <7E039918541B4C4183BFDB8F015C7430C4BBF9AB@WCL-EXCH02.wcl.local> X-Now-Playing: Joe Jackson's _Mike's Murder_: "Zemeo" Date: Thu, 12 May 2022 18:30:49 +0200 In-Reply-To: <7E039918541B4C4183BFDB8F015C7430C4BBF9AB@WCL-EXCH02.wcl.local> (Ed Avis's message of "Mon, 21 Mar 2016 14:46:10 +0000") Message-ID: <87r14yww5i.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Ed Avis 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 f [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ed Avis 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 From debbugs-submit-bounces@debbugs.gnu.org Thu May 12 12:31:07 2022 Received: (at control) by debbugs.gnu.org; 12 May 2022 16:31:08 +0000 Received: from localhost ([127.0.0.1]:42078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npBiV-0000b7-Ew for submit@debbugs.gnu.org; Thu, 12 May 2022 12:31:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npBiU-0000Ul-72 for control@debbugs.gnu.org; Thu, 12 May 2022 12:31:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=r/6r9JvA5ei2nrb1nVfOzk6oR1sq+qZtN25CJRDRr1E=; b=oBGxTR+DFcHlwWdt8rtG/7HeR1 ouxwozojipHTk9Mk5SeWQhrYb6vhTiv94RWjSdFVZoL+ugI6h8M4CCNy33n30kSXhFQRqJuEBSqrX mdo1iSZdQIoqWlEwMwwm+sUuco/ibW9NEaPD8NLYVaFbJdhgnZbt+z6Cnf5zTHvOxC9Q=; Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npBiM-0006uw-7j for control@debbugs.gnu.org; Thu, 12 May 2022 18:31:00 +0200 Date: Thu, 12 May 2022 18:30:55 +0200 Message-Id: <87pmkiww5c.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #23078 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 23078 wontfix close 23078 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 23078 wontfix close 23078 quit