From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#65854: Multi-file replacement diff Date: Wed, 27 Sep 2023 00:39:09 +0300 Message-ID: <551d5fee-28ab-f642-3ed4-baf0029cdef9@gutov.dev> References: <86sf7mgd54.fsf@mail.linkov.net> <0f06a505-a441-133f-00a1-50dd55d18b33@gutov.dev> <86zg1cvx8l.fsf@mail.linkov.net> <86cyy6yw0s.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40527"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: 65854@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 26 23:40:08 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 1qlFmo-000AGy-VC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Sep 2023 23:40:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlFma-00020A-FI; Tue, 26 Sep 2023 17:39:52 -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 1qlFmX-0001zt-Iv for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 17:39:49 -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 1qlFmX-0007t2-Av for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 17:39:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qlFmk-0004MC-GR for bug-gnu-emacs@gnu.org; Tue, 26 Sep 2023 17:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Sep 2023 21:40: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.169576437516704 (code B ref 65854); Tue, 26 Sep 2023 21:40:02 +0000 Original-Received: (at 65854) by debbugs.gnu.org; 26 Sep 2023 21:39:35 +0000 Original-Received: from localhost ([127.0.0.1]:49984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlFmI-0004LL-O1 for submit@debbugs.gnu.org; Tue, 26 Sep 2023 17:39:35 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:51077) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qlFmF-0004L6-Ub for 65854@debbugs.gnu.org; Tue, 26 Sep 2023 17:39:33 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id D62405C2638; Tue, 26 Sep 2023 17:39:12 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 26 Sep 2023 17:39:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1695764352; x=1695850752; bh=5tBhWu/WTvC+n6nAlZ9rNmONzggT0GbhsCD iA9PyeZA=; b=UWCNz6Lp53QCVdKvChKpPmvwjQPIADYD3beaAhy57YoZB1hGHhP Mqh3q2f9Cg6+QJdOL4X/NIs5Llek4puyeB8l5H3T2q8glKmRDPSrxc7FxPW2cJGE Drg6UcQZ7/4TPGk3tRjCaOCGSW7fE2dTstUQfz9/KDLbgv2BSmbANionzNRGprxq Y5ubqCGwZo15NvAcAemKzFeYjpiwKVngNYvIUFvT1JQIhJFqVBf5EF4twoijtbyx 7/WW6WuQ/KMRRKAb2+686FUg67xoT4f/GTy6oGlrD4Cev6G5pGhaWCfIvPgcpdAB Hj9MTrUcuXSN7pMWlN1aVW2RqW4B8ssaBKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1695764352; x=1695850752; bh=5tBhWu/WTvC+n6nAlZ9rNmONzggT0GbhsCD iA9PyeZA=; b=dxKefMV0NVK/3PsCpUpITESttJN1v8ghRGRd0Hu9h2SF6rpChsN Vf3TO0SEMWrTBKcYMuzMbwsVYeSCVffSpBC581gi/naIxJdGA/din3Dwm1gb3YjQ qTKgsBPuECmZNCj+ecH9VETv0QJIF2wNhbWf7so+5TznpzNQte9ubESdZXjK609d c5SPWBA2j1AY1bJ2Q3c+NneeKvIkDT6IPYe18h9t+sSkuERo87mOelvzxtR3tYOr zWiwvtdRsfbpy0D1QlWxHMT9W/iUaDwbxsiNHE1AgXNlSkl8zjbVDEl1p1Yj7k1I Wm1+7k7te01u2PPj76/c8TRHy7RDPpYNJgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvjedrtddugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeevledv veenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Sep 2023 17:39:11 -0400 (EDT) Content-Language: en-US In-Reply-To: <86cyy6yw0s.fsf@mail.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:271397 Archived-At: On 25/09/2023 20:58, Juri Linkov wrote: >> 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. Yes, that should help. Even having your patch in the bug tracker to refer to already helps (as well as the discussion around it). I'm just saying that if Eglot has its own existing custom vars, and misearch.el has its own, it will take extra effort to unify them (or keep extra options inside said packages, I guess, increasing unavoidable duplication).