From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Alfred M. Szmidt" Newsgroups: gmane.emacs.devel Subject: Re: Adding refactoring capabilities to Emacs Date: Tue, 26 Sep 2023 01:36:27 -0400 Message-ID: References: <83fs4f36wi.fsf@gnu.org> <1b963d24-51b3-8128-ad14-e4af2c9f0c43@gutov.dev> <8408fa63-af93-ab36-8524-fa12de7918ea@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4397"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joaotavora@gmail.com, monnier@iro.umontreal.ca, eliz@gnu.org, philipk@posteo.net, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 26 07:37:27 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 1ql0lB-0000wD-UP for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Sep 2023 07:37:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ql0kL-0001BH-9e; Tue, 26 Sep 2023 01:36:33 -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 1ql0kJ-0001B4-0b for emacs-devel@gnu.org; Tue, 26 Sep 2023 01:36:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ql0kG-0004Op-NJ; Tue, 26 Sep 2023 01:36:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=JBulQSKloH8YXxacc+akquzlgXc8Bxw+CHiKRnsxPNE=; b=QNohmHhsdOz4 fsiBxJo72iP/hpKAZN1FI0d2tL1IwbOxiLGTfxw8bk5bCp1cZHU2VkkD/Xus85GeuK+kbIXkCLnqp z1zwAROFGxxNP/IBsCi302SRmzmZFIo4InEnXYXLdWzgjT+HrfrgXjonSED2cYeNz90ZYLlrr5SRf JazFJGH3bvXWCPQcjHndXT8UnqB4yKjrrihfcLOS4hOQLc+js3cAvQxMe1lVTwBWk6pm5nhnxEB86 WoU5iOLsJRo9OLsxFifDQvQnq67THLmXIIJvhc9jbHYRZTf0U4jAQwL9fOKWgyBfo45KXsP5h32kT zsvgbNEBY9T9Hf83M/u2BA==; Original-Received: from ams by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1ql0kF-0004Lo-1H; Tue, 26 Sep 2023 01:36:28 -0400 In-Reply-To: <8408fa63-af93-ab36-8524-fa12de7918ea@gutov.dev> (message from Dmitry Gutov on Tue, 26 Sep 2023 02:11:49 +0300) 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:311047 Archived-At: (Sorry, for resurrecting this subthread, but...) Should we make diff-mode always start in read-only-mode? It's currently inconsistent: read-only in some cases (vc-diff) and writable in others (visiting a patch file on disk). Does it need to be consitent? These are two I would think entierly different use cases of diff-mode... and warrent different behaviour. If you have a diff on file, you are most probobly going to apply it, and also probobly going to remove a hunk or two or edit the diff in some manner. (That this is "relatively rare" I disagree from my own usage and experience). Not to mention that visiting a file on disk, that is read-write, and Emacs making it read-only would be very strange. With vc-diff (similar, diff-buffer-with-file) you are diffing whatever you have against VC (or file), there is little point to edit via the diff, and you'd more likley just save this to file or an email. So in those cases the buffer being read-only makes more sense. Whereas, I think, in both cases editing the diff itself is a relatively rare operation. Most of the time, I visit a patch, press some key (such as n or p), curse slightly, press 'undo', turn on read-only-mode, and then continue with the real work.