From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65347: 29.1; Underscore in query replace prevents case-matching Date: Fri, 18 Aug 2023 22:29:04 +0300 Message-ID: <83o7j42lq7.fsf@gnu.org> References: <838raa6syr.fsf@gnu.org> <83o7j451iu.fsf@gnu.org> <83wmxs2p52.fsf@gnu.org> <83sf8g2mrr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33972"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65347@debbugs.gnu.org, monnier@iro.umontreal.ca To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 18 21:30:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qX5Aw-0008Xr-BW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Aug 2023 21:30:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qX5AZ-000684-Kb; Fri, 18 Aug 2023 15:30:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qX5AY-00067Y-2o for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 15:30:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qX5AX-00024y-OU for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 15:30:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qX5AY-00057y-9F for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 15:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Aug 2023 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65347 X-GNU-PR-Package: emacs Original-Received: via spool by 65347-submit@debbugs.gnu.org id=B65347.169238694419598 (code B ref 65347); Fri, 18 Aug 2023 19:30:02 +0000 Original-Received: (at 65347) by debbugs.gnu.org; 18 Aug 2023 19:29:04 +0000 Original-Received: from localhost ([127.0.0.1]:48843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qX59b-000560-IJ for submit@debbugs.gnu.org; Fri, 18 Aug 2023 15:29:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qX59Z-00055U-Iq for 65347@debbugs.gnu.org; Fri, 18 Aug 2023 15:29:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qX59S-0001vZ-VA; Fri, 18 Aug 2023 15:28:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=/EyrjfAXHsHAFe1lJpnrooL5FB4nCfZARqhZ3JXST6g=; b=SUwcG+3qJVUE HFhfqdgSh390vlT0TLB756u6iaKi9umVefVlDfGM4m7p8oU4GR/3kkgVIp6nF+ZzB9ZG3/24GLI3H Sy0dt89Iy5nz4A4iugBK74QvE/hgUPAVpRfOzEug8rO1YFKFKFZgsXNlYU0w3MjTRCwR28A70seBL jLONDLnvsvLst1DNgJS8nfXw0Nws9JmQs4GfHLHpFmKCNP17PfEz0dUYO5KU+cLYGXX9Crv2SjmEv Azr5zemP37Oksca00IJzIsMuV3ooSaogtgitPSYsqB6iYaZ3y1HygrIsoDKpnUtgkcTxIDsdVCpmA 0BbhGllY8CN69awgRnXRqg==; In-Reply-To: (message from Spencer Baugh on Fri, 18 Aug 2023 15:14:46 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267786 Archived-At: > From: Spencer Baugh > Cc: 65347@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Fri, 18 Aug 2023 15:14:46 -0400 > > > What are "symbols" in this context? > > Strings made up of symbol constituents as defined by the current > major-mode's syntax table. The normal definition of symbols. Then you are talking about something very different from "words". > > Capitalization issues with program code are conceptually different > > from those with human-readable text. You are basically talking about > > refactoring, not about text replacement. So the use cases that are of > > interest to you are not well supported by query-replace, because it > > doesn't target them. It could well mean that you will need a custom > > replace-match function. Insisting on replace-match to support these > > cases is not necessarily wise, from where I stand. > > Hm, that's fair. Although I would bet that the majority of usage of > query-replace is with program code, since the majority of Emacs usage is > with program code. That's profoundly not true! Emacs is used with human-readable text not less, and maybe more, than with program source code. I'm typing this email in Emacs; I'm routinely making changes to our documentation in Emacs -- these and others are all frequent text-editing activities. > So features which make query-replace work better with code are still > useful. No, we need a real refactoring in Emacs! Using M-% as poor-man's refactoring is fine, but pretending that it _is_ refactoring, and adding minor extensions to it that are motivated by refactoring, is simply wrong! It will likely complicate the text-oriented replacement we have already, and will always fall short of decent refactoring capabilities. We should work on adding refactoring instead of tweaking M-% and M-* in these directions. > Another feature that could support this would be to allow defining > multiple query/replacement pairs, and applying them together across the > file or across multiple files, querying as we go. Then "foo" could be > replaced with "bar" and "Foo" with "Bar". That kind of simultaneous > replacement is something I've definitely wanted before. IMO, this makes little or no sense in human-readable text; it does make sense in the refactoring context. So let's add refactoring capabilities to Emacs, and leave M-% for text.