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: Sun, 24 Sep 2023 10:36:20 +0300 Organization: LINKOV.NET Message-ID: <86zg1cvx8l.fsf@mail.linkov.net> References: <86sf7mgd54.fsf@mail.linkov.net> <0f06a505-a441-133f-00a1-50dd55d18b33@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11765"; 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 Sun Sep 24 09:43:21 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 1qkJlw-0002wT-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 24 Sep 2023 09:43:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkJlT-000461-R8; Sun, 24 Sep 2023 03:42:51 -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 1qkJlS-000452-AQ for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 03:42: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 1qkJlS-0000xd-2f for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 03:42:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkJld-0006Ba-Mp for bug-gnu-emacs@gnu.org; Sun, 24 Sep 2023 03:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Sep 2023 07:43:01 +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.169554134923721 (code B ref 65854); Sun, 24 Sep 2023 07:43:01 +0000 Original-Received: (at 65854) by debbugs.gnu.org; 24 Sep 2023 07:42:29 +0000 Original-Received: from localhost ([127.0.0.1]:40931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkJl7-0006AX-4U for submit@debbugs.gnu.org; Sun, 24 Sep 2023 03:42:29 -0400 Original-Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]:40399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkJl2-0006A0-KI for 65854@debbugs.gnu.org; Sun, 24 Sep 2023 03:42:26 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 778E420003; Sun, 24 Sep 2023 07:42:03 +0000 (UTC) In-Reply-To: <0f06a505-a441-133f-00a1-50dd55d18b33@gutov.dev> (Dmitry Gutov's message of "Sun, 24 Sep 2023 04:43:00 +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:271219 Archived-At: >> 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.