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#73387: 30.0.90; C-x v v in diff-mode doesn't work after C-c C-n Date: Tue, 1 Oct 2024 04:15:19 +0300 Message-ID: <16230560-cad5-4cc9-a272-a0f961247158@yandex.ru> References: <87zfo28fzu.fsf@zephyr.silentflame.com> <8d0b046e-4b29-4551-b421-e98e212a7b40@yandex.ru> <86msjxefkv.fsf@mail.linkov.net> <87cykt2gkl.fsf@zephyr.silentflame.com> <87jzf01bsk.fsf@zephyr.silentflame.com> <87y13dfgzz.fsf@melete.silentflame.com> <5e956e3b-5891-401a-a898-e339f52ea307@yandex.ru> <87h69ydnvd.fsf@melete.silentflame.com> <878qv9scps.fsf@melete.silentflame.com> <12b28146-5cbc-48cd-b0e2-0c528d4b9b1c@yandex.ru> <87ikudqocz.fsf@melete.silentflame.com> <9be40a05-3260-40a8-9c35-c5daac413844@yandex.ru> <87wmisprfk.fsf@melete.silentflame.com> 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="35902"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 73387@debbugs.gnu.org, monnier@iro.umontreal.ca, Juri Linkov To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 01 03:16:53 2024 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 1svRVV-0009C3-3y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Oct 2024 03:16:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svRVF-0000ZE-1F; Mon, 30 Sep 2024 21:16:40 -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 1svRV8-0000Kj-OX for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 21:16:31 -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 1svRV6-0005sN-Kg for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 21:16:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=dE6e4foHHxTEV+Td3mP1NsNetFRNJzyGMUrK3YhM+Hs=; b=Bx/Ye8rrjUOWVwC9C4e8MSXJDTA8PcbCVkB98h/ZVU7J3RqmF85qqNDLiomUJemr8KtJO8gJeeY2B45/iN480xq46AKFqxRdBlEI6wX8clOmke05MQHEQUoEAWs6I4oHNHa5/eO5tUzNq7aW/C/ZJ/i89G+yunhw98UT9aaDTiSD7ToaL1h0GAmJIcKjAmfuLtiJih3CVrpKfRywj4JRrhM/vRijm3sKMPgB+qzZwaTDRDk0YCDGlzqIzNwKkSxG12p2tV+03i5prOqGal0gE3nrvmgv9YEYQaSNtDGRmfm2Sj6xGsFnjPhjyIebbYBij9yb0/zRTHyKYXHt8fs6MA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svRVd-0001IK-OH for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 21:17:01 -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, 01 Oct 2024 01:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73387 X-GNU-PR-Package: emacs Original-Received: via spool by 73387-submit@debbugs.gnu.org id=B73387.17277453664931 (code B ref 73387); Tue, 01 Oct 2024 01:17:01 +0000 Original-Received: (at 73387) by debbugs.gnu.org; 1 Oct 2024 01:16:06 +0000 Original-Received: from localhost ([127.0.0.1]:48207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svRUk-0001HT-3n for submit@debbugs.gnu.org; Mon, 30 Sep 2024 21:16:06 -0400 Original-Received: from forward500b.mail.yandex.net ([178.154.239.144]:38864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svRUh-0001H8-AB for 73387@debbugs.gnu.org; Mon, 30 Sep 2024 21:16:05 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net [IPv6:2a02:6b8:c08:df8e:0:640:17d3:0]) by forward500b.mail.yandex.net (Yandex) with ESMTPS id 5B93B612C6; Tue, 1 Oct 2024 04:15:26 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id NFOSwHtg28c0-LPNB5PzR; Tue, 01 Oct 2024 04:15:25 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1727745325; bh=dE6e4foHHxTEV+Td3mP1NsNetFRNJzyGMUrK3YhM+Hs=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=mr7HVQA2CkuWclTyC8y0nd0A+WQ29UQoqruOllKLFq7u3fI/oJ6ORL5E2jJKTq7Sl 2HIAdDydFOsZdqe5+a4F1C3b2v2k5dCR/dXxE6rxp6bgaYlvWPPNO75Ks9YwitO+g2 FisljnAaPw0+2iCEOhwPQsF2Wz+4uv0pWFw52+ns= Authentication-Results: mail-nwsmtp-smtp-production-main-44.sas.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfauth.phl.internal (Postfix) with ESMTP id E75511200043; Mon, 30 Sep 2024 21:15:22 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Mon, 30 Sep 2024 21:15:22 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduiedggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrd hruheqnecuggftrfgrthhtvghrnhepiefhjeeuveetffffvdefteffffekhfeuudejieeh heeiudelgfehgffffeduffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqddufeeffeelleehhedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvg igrdhruhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopeegpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrd hnrghmvgdprhgtphhtthhopeejfeefkeejseguvggssghughhsrdhgnhhurdhorhhgpdhr tghpthhtohepmhhonh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Sep 2024 21:15:21 -0400 (EDT) Content-Language: en-US In-Reply-To: <87wmisprfk.fsf@melete.silentflame.com> X-Yandex-Filter: 1 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:292753 Archived-At: On 01/10/2024 04:01, Sean Whitton wrote: > I don't think that's quite right. > > If you use C-c C-n in a diff-mode buffer with current master, then > C-x v v doesn't get far enough to call the user-error I added. > "No next file" is not the error message that you should get. Ah, okay. Building the list and then not using it feels kind of wasteful, though. Should we move the check earlier? I.e. do this (and probably remove it from vc-next-action): diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 25c6238765d..33bd8b607f7 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -3168,6 +3168,17 @@ diff-syntax-fontify-props ;;;###autoload (defun diff-vc-deduce-fileset () + (when (buffer-narrowed-p) + ;; If user used `diff-restrict-view' then we may not have the + ;; file header and the commit will not succeed (bug#73387). + (user-error "Cannot commit patch when narrowed; consider %s" + (mapconcat (lambda (c) + (key-description + (where-is-internal c nil t))) + '(widen + diff-delete-other-hunks + vc-next-action) + " "))) (let ((backend (vc-responsible-backend default-directory)) files) (save-excursion