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.devel Subject: Re: [Patch] Add project.el command to replace symbol at point throughout project Date: Thu, 13 Jan 2022 10:25:18 +0200 Message-ID: <83czkw3uvl.fsf@gnu.org> References: <83zgo2770l.fsf@gnu.org> <83zgo15dhp.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19341"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eskinjp@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 13 09:27:17 2022 Return-path: Envelope-to: ged-emacs-devel@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 1n7vS0-0004sO-NF for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Jan 2022 09:27:16 +0100 Original-Received: from localhost ([::1]:54884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7vRz-0001yG-IZ for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Jan 2022 03:27:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7vQB-0000OE-J6 for emacs-devel@gnu.org; Thu, 13 Jan 2022 03:25:23 -0500 Original-Received: from [2001:470:142:3::e] (port=39334 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7vQ9-0005WC-DM; Thu, 13 Jan 2022 03:25:23 -0500 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=9wyQZF20cvJB4QKLJekZmKJYFOMiYRiHmZuT8tL4usE=; b=UWsKXTAGmvGH gNIScJsPvsk/LP8BtnREzXsxG46sS9J9Lsz7dwG5CRKJAqIuf7bXwnltPluaLTDXokElJrBtw5A9I m4NY+hj+JwK7OE65nZqNfHOp+YfF56OzASqclyGKR/+sQ+1bf6uqVYNuea5SM3AG2fPtQJ6bbX0Gi xKtFu5GKovWM1I+8JZYrfUpB5so2A79k9LCV+oBqXP2outzDF2SDeLVnrWez9nlODUKREEE/HnLy5 bbfIoPNYwWCJhJLFz7Y95HQyTRREXWef4wujIp3FL2OnsbKbh2p80sNDOCk9V4qtsj5PxJXhR1jBn /FbOsijo/dwmv4K+SeLQVA==; Original-Received: from [87.69.77.57] (port=2338 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7vQ9-0002pE-3T; Thu, 13 Jan 2022 03:25:21 -0500 In-Reply-To: (message from Dmitry Gutov on Thu, 13 Jan 2022 03:19:12 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284686 Archived-At: > Cc: eskinjp@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov > Date: Thu, 13 Jan 2022 03:19:12 +0200 > > The conceptual problem with that is we have a number of commands which > produce a list of matches in an Xref buffer: > > xref-find-references, > xref-find-apropos, > project-find-regexp, > project-or-external-find-regexp > > They're all fairly, so I won't think there's a change of implementing > any meaningful automatic switching based on context. > > Do we create the -and-replace counterpart only for xref-find-references? Yes, that's what I wanted to propose. > There's also dired-do-find-regexp for which we have added said > counterpart already (dired-do-find-regexp-and-replace), but that was > primarily for backward compatibility of the UI. Right. > >> Or you can do a search with M-? and then press 'r'. Have you tried that? > > > > At some point. But I think someone who wants refactoring might have > > trouble discovering that, and a separate command will make that > > easier. > > I rather remember the old recommendation to 'M-x find-grep-dired' > followed by '% m RET .*' and 'M-x dired-do-query-replace-regexp', when > one wanted to replace across the project. I think we're rather spoiled > these days by comparison. > > Anyway, if you're sure adding xref-find-references-and-replace will > help, I've got no problem with that. I think it will be a good addition to what we already have in that department. And given that we document it in the user manual, it should become known to users soon enough.