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:06:32 +0300 Message-ID: <83sf8g2mrr.fsf@gnu.org> References: <838raa6syr.fsf@gnu.org> <83o7j451iu.fsf@gnu.org> <83wmxs2p52.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1196"; 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:07:11 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 1qX4oR-000Adi-8Y for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Aug 2023 21:07:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qX4oI-0001gH-IN; Fri, 18 Aug 2023 15:07:02 -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 1qX4oI-0001g5-1d for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 15:07: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 1qX4oH-00062e-Ql for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 15:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qX4oI-0004VW-Ag for bug-gnu-emacs@gnu.org; Fri, 18 Aug 2023 15:07: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:07: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.169238559117276 (code B ref 65347); Fri, 18 Aug 2023 19:07:02 +0000 Original-Received: (at 65347) by debbugs.gnu.org; 18 Aug 2023 19:06:31 +0000 Original-Received: from localhost ([127.0.0.1]:48808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qX4nn-0004Ua-3y for submit@debbugs.gnu.org; Fri, 18 Aug 2023 15:06:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qX4nl-0004UN-DC for 65347@debbugs.gnu.org; Fri, 18 Aug 2023 15:06:29 -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 1qX4ne-0005nr-Ev; Fri, 18 Aug 2023 15:06:22 -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=jkqWJRS1IBxqyTnIw3OUwtCMVnc2cCbzvdxGSumPt2E=; b=OCD5YQapkk+o BQQZe4v6dzal+qBJDT5dsK62lbMb5BrHS5CnazXsBpZXBjrUCgS+xDkgXFKm81oH+nZ3sXYBCriJo PQt2QKt+ZBPt69SqkJWhNPhOcRtUnDa0oIXuFLKiSuU5fZi6QkYkayigzK5Zngd/0o+HeAFyR55ns Da1m+kVHojj4Ft+dH9X5eftWvBPyFoIgioXYKQ3PQVTzrCycZP+okHRrwWoVLcpWlaDJxwT6QTYVT VejNCkSWiucGuis4/WkVNrz37Ml2FZW5AWHn6MKPBtOuo8k6HUren/TMBJnOHI3ckC3dGFkjysHAm oHfdch4/7wls8/wPNe0Wkg==; In-Reply-To: (message from Spencer Baugh on Fri, 18 Aug 2023 14:31: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:267782 Archived-At: > From: Spencer Baugh > Cc: 65347@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Fri, 18 Aug 2023 14:31:46 -0400 > > > Here, you look at the issue from a very narrow perspective: of words > > separated by '-' or '_', because that just happens to be the case that > > you bumped into. But that is just one very particular use case; words > > can be separated by a lot more characters. I would actually begin > > considering the simpler case of "Foo do action". > > But no, this use case very specifically is about replacing symbols > (sexps) while matching case. What are "symbols" in this context? > I don't much care about the word boundary or superword-mode, because I'm > not dealing with words - I'm very deliberately dealing with symbols. 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. > What about the other thing I proposed? That's what I'm more interested > in, because this is a problem of replacing symbols. And it's much more > elegant. Repeated here: > > >>Alternatively, much more interestingly, the case-matching could *always* > >>detect case patterns both for symbols and for words. And if there's no > >>case pattern for words, but there is a case pattern for symbols, apply > >>that case pattern to symbols in the replacement. We could even turn > >>that on by default. Does that sound like a good change? I can make > >>that change if it sounds desirable. I don't understand the proposal. Again, what are "symbols" in this context, and how are they different from "words"?