From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#64071: 28.2; smerge-diff creates *vc-diff* without setting it up Date: Tue, 27 Jun 2023 16:17:45 -0400 Message-ID: References: <83ttv9tcnh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39146"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier , 64071@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 27 22:18:20 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 1qEF8m-0009zc-8U for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jun 2023 22:18:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEF8V-0002Qc-LQ; Tue, 27 Jun 2023 16:18:03 -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 1qEF8U-0002Ph-Im for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 16:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEF8U-0002lD-Av for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 16:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEF8T-0002Sg-S1 for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 16:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jun 2023 20:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64071 X-GNU-PR-Package: emacs Original-Received: via spool by 64071-submit@debbugs.gnu.org id=B64071.16878970739448 (code B ref 64071); Tue, 27 Jun 2023 20:18:01 +0000 Original-Received: (at 64071) by debbugs.gnu.org; 27 Jun 2023 20:17:53 +0000 Original-Received: from localhost ([127.0.0.1]:49583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEF8L-0002SJ-EA for submit@debbugs.gnu.org; Tue, 27 Jun 2023 16:17:53 -0400 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:37003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEF8J-0002S4-QV for 64071@debbugs.gnu.org; Tue, 27 Jun 2023 16:17:53 -0400 In-Reply-To: <83ttv9tcnh.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Jun 2023 10:20:18 +0300") 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:264178 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Date: Wed, 14 Jun 2023 17:41:39 -0400 >> >> 1. emacs -Q >> 2. Create a buffer containing: >> <<<<<<< left >> foo >> ======= >> bar >> >>>>>>> right >> 3. M-x smerge-mode >> 4. M-x smerge-diff-upper-lower >> 5. The resulting *vc-diff* buffer is in diff-mode but it's not >> read-only, which is unusual for a *vc-diff* buffer. > > That command enters diff-mode, and diff-mode doesn't force read-only > status on the current buffer. Why should Smerge force that? Buffer named "*vc-diff*" are universally read-only, except if they are created through this path. (Because they're otherwise only created by vc, which marks them read-only.) It breaks user expectations for a *vc-diff* buffer to not be read-only. >> Probably there is also other setup missing. > > Which ones, and to what mode they belong? Setup done by vc when it creates *vc-diff* buffers. After doing a little investigation, it looks like the read-only setting is the most important divergence after all. Maybe we should be calling diff-setup-whitespace, and maybe we should be running vc-diff-finish-functions. Possibly not though. >> Relatedly, if a *vc-diff* buffer already exists, smerge-mode will use it >> without updating the mode-line, so it will say, for example, "Diff from >> *vc-change-log*" despite the diff being from smerge conflict resolution. > > This should probably be easy to fix, and the fix should be safe enough > for the emacs-29 branch. How about proposing such a fix, and leaving > the more controversial aspects of this alone for now? Hm, honestly I only care about the read-only-mode, that's by far most confusing thing about this. I've gotten user complaints about that specifically being confusing, so that's what I'd like to fix. Stefan likes my simple patch, so what's wrong with it?