From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64071: 28.2; smerge-diff creates *vc-diff* without setting it up Date: Thu, 15 Jun 2023 11:09:02 -0400 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26343"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64071@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 15 17:10:26 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 1q9ocE-0006d1-4J for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 15 Jun 2023 17:10:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9obr-0003s5-Ko; Thu, 15 Jun 2023 11:10: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 1q9obq-0003ru-Hc for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2023 11:10: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 1q9obq-0005Xy-7N for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2023 11:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q9obp-0007cx-N5 for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2023 11:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Jun 2023 15:10: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.168684175629264 (code B ref 64071); Thu, 15 Jun 2023 15:10:01 +0000 Original-Received: (at 64071) by debbugs.gnu.org; 15 Jun 2023 15:09:16 +0000 Original-Received: from localhost ([127.0.0.1]:47540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9ob6-0007bw-3K for submit@debbugs.gnu.org; Thu, 15 Jun 2023 11:09:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9ob4-0007bg-KS for 64071@debbugs.gnu.org; Thu, 15 Jun 2023 11:09:15 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8E5291000CA; Thu, 15 Jun 2023 11:09:08 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 23D67100089; Thu, 15 Jun 2023 11:09:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1686841743; bh=emurp2WcT0COiydAlikR4HzHk12dIcu11ICiO/pal1I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YNlllqS6+Rid9mcuxfGSvN/ocbh5XrjtQd/++cUQgUl/7OpZxJ6sf3nNEGTBc2o5I 26+3hlcPq8X9ES8hU5bvZ9sOVdVH/a3VLkRi7xSUTY2i9K1TZkhUOGPNiJ5WYfgdYY Gp23n2hmdpCaBssNCbcNGqdjScjVJNMCKzajCeSBNF33UmZylJVmt/p5E5OARS0v0q FyBWlXy9PVBM5jw91BYWcjOoU2fU+5wgWHrLzW6GA8xLwbkUmv57edCMCN0sRyRxEb 0HpBDDWaIobMKkYTuiVgXsXH/syj5DF7ZPlYrH4MCY34MNvb6nsMLEBrP32omOhPNF u/7J2ayVwAjew== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1517C120228; Thu, 15 Jun 2023 11:09:03 -0400 (EDT) In-Reply-To: (Spencer Baugh's message of "Wed, 14 Jun 2023 17:41:39 -0400") 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:263426 Archived-At: > 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. Probably there is > also other setup missing. Good catch, indeed. > 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. Hmm... that's also a bug, indeed. I'm tempted to say that maybe the bug is in the code which changed the `mode-line-format` (it should arguably either not change it, or arrange to have it reset when it doesn't match the buffer's contents any more). > This bug is also present in Emacs 29 and trunk. > > The below diff resolves the read-only part. But maybe we want to be > creating the *vc-diff* by calling into vc, which would also fix the > mode-line part? > > diff --git a/lisp/vc/smerge-mode.el b/lisp/vc/smerge-mode.el > index c39a9cc2f22..65d93c17a64 100644 > --- a/lisp/vc/smerge-mode.el > +++ b/lisp/vc/smerge-mode.el > @@ -1259,6 +1259,7 @@ smerge-diff > (if (eq status 0) (insert "No differences found.\n")))) > (goto-char (point-min)) > (diff-mode) > + (read-only-mode) > (display-buffer (current-buffer) t)) > (delete-file file1) > (delete-file file2)))) LGTM. Stefan