From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#65854: Multi-file replacement diff Date: Mon, 25 Sep 2023 20:58:59 +0300 Organization: LINKOV.NET Message-ID: <86cyy6yw0s.fsf@mail.linkov.net> References: <86sf7mgd54.fsf@mail.linkov.net> <0f06a505-a441-133f-00a1-50dd55d18b33@gutov.dev> <86zg1cvx8l.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1466"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 65854@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 25 20:01: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 1qkptN-0000EM-Rl for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Sep 2023 20:01:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkptD-0005IV-07; Mon, 25 Sep 2023 14:00:59 -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 1qkpt4-000523-A8 for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 14:00:50 -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 1qkpt4-0002xN-13 for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 14:00:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkptG-0006EJ-EL for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 14:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Sep 2023 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65854 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65854-submit@debbugs.gnu.org id=B65854.169566482618546 (code B ref 65854); Mon, 25 Sep 2023 18:01:02 +0000 Original-Received: (at 65854) by debbugs.gnu.org; 25 Sep 2023 18:00:26 +0000 Original-Received: from localhost ([127.0.0.1]:46624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkpsg-0004o0-0K for submit@debbugs.gnu.org; Mon, 25 Sep 2023 14:00:26 -0400 Original-Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]:38799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkpse-0004S6-Q1 for 65854@debbugs.gnu.org; Mon, 25 Sep 2023 14:00:25 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 0158AFF80B; Mon, 25 Sep 2023 18:00:02 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Sun, 24 Sep 2023 14:09:11 +0300") X-GND-Sasl: juri@linkov.net 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:271347 Archived-At: > On 24/09/2023 10:36, Juri Linkov wrote: >>>> As discussed on emacs-devel, here is the patch that implements >>>> a standalone command that reads a list of files and replacement strings, >>>> then shows a diff to review before applying replacements. >>>> Also provided the Dired integration to show the replacement diff >>>> on marked files. Later the same function could be used >>>> to show replacement diffs from the xref buffer and maybe >>>> from other packages as well. >>> Here's a counter-proposal: we were talking about a "refactoring" packages >>> on emacs-devel, maybe a week ago. And I suggested a function that would >>> take a list of changes (as some data) and present them using some >>> customizable logic: the current Eglot's solution uses a diff, and I'll add >>> an implementation that shows a tree-like buffer with checkmarks, probably. >>> >>> I'll be starting on this any day now ;-( >>> >>> So... provided this won't take too long, I would suggest your code here >>> just focuses on creating a list of changes (those shouldn't require buffers >>> to visit files), and then you'd be able to pass them on to >>> 'refact-show-changes' (name under construction), which would then use the >>> interface that the user prefers. >>> >>> This was we'll also consolidate the diff-generating code for features of >>> this sort. >> I'm not sure this complication is necessary. The proposed patch >> does its job already. So more generalizations could be added later. > > If you are sure. > > I just wouldn't want to keep unnecessary defcustoms around. Actually my point was that there is already eglot--propose-changes-as-diff. And now with addition of multi-file-replace-as-diff you will have two cases to generalize that would be simpler to do than with only one case.