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.devel Subject: Re: Adding refactoring capabilities to Emacs Date: Tue, 05 Sep 2023 09:43:44 +0300 Organization: LINKOV.NET Message-ID: <86bkehjf1b.fsf@mail.linkov.net> References: <83fs4f36wi.fsf@gnu.org> <61621120-8f6d-5884-e7c8-33581b8e0ca4@gutov.dev> <87edjkuv0s.fsf@gmail.com> <0bba73a6-f9a5-91c8-ef56-a58951706490@gutov.dev> <86msy1c0p7.fsf@mail.linkov.net> <4fde0376-3c19-a634-b77a-e836f9e86607@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="3616"; 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: =?iso-8859-1?Q?Jo=E3o_T=E1vora?= , Yuri Khan , Eli Zaretskii , emacs-devel , "Philip K." To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 05 08:56:47 2023 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 1qdPzT-0000hO-EQ for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Sep 2023 08:56:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdPyU-0006qB-10; Tue, 05 Sep 2023 02:55:46 -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 1qdPyS-0006pn-UG for emacs-devel@gnu.org; Tue, 05 Sep 2023 02:55:44 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPyQ-0005jn-Ji; Tue, 05 Sep 2023 02:55:44 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 469901C0002; Tue, 5 Sep 2023 06:55:36 +0000 (UTC) In-Reply-To: <4fde0376-3c19-a634-b77a-e836f9e86607@gutov.dev> (Dmitry Gutov's message of "Mon, 4 Sep 2023 21:04:48 +0300") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=217.70.183.197; envelope-from=juri@linkov.net; helo=relay5-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310114 Archived-At: >> A possible solution would be to support a region by 'C-c C-a'. >> Then it will be possible to activate the region on the whole buffer >> or on a few hunks, and type a single 'C-c C-a'. > > Another problem is trying to do an atomic revert if a large diff, across > multiple files, fails to apply somewhere in the middle. > >> Another problem that the changes are not saved automatically >> on multiple files. This limitation forces to use tricks like >> 'M-| git apply RET' after selecting the whole diff buffer with 'C-x h' >> or a region of the diff buffer. A "poor man's auto-save". > > This approach might help with the above, though. Indeed, and an atomic revert in case of no errors (just when the user changes the mind) is to do 'C-c C-r' ('diff-reverse-direction'), and then 'M-| git apply RET' again. But the drawback of this approach is that visited files will be out of sync that requires reverting with losing their content.