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, 24 Sep 2024 20:36:32 +0300 Message-ID: References: <87zfo28fzu.fsf@zephyr.silentflame.com> <8d0b046e-4b29-4551-b421-e98e212a7b40@yandex.ru> <86msjxefkv.fsf@mail.linkov.net> <87cykt2gkl.fsf@zephyr.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="15619"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 73387@debbugs.gnu.org, monnier@iro.umontreal.ca To: Sean Whitton , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 24 19:37:52 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 1st9Tz-0003uM-Kd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Sep 2024 19:37:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st9Tn-0007nQ-8j; Tue, 24 Sep 2024 13:37:39 -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 1st9Tl-0007nI-Sw for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 13:37:38 -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 1st9Tl-00033e-Jn for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 13:37:37 -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=fMRiArU6ShkrXoMWlKRvpQ6D8qAzDyjcOOHib5L1tDU=; b=TVYiQn8ah2IZlRhedbyMea1Oid04stT45vLDgMHU5ZMNtP0EtPkTGP6h4Zidk7Xm/b4OvgJj5y1p1tYsni93CHgVPOPhCq0+xX/ZATwJBoV90m/ayNKmyfnMPNA1glArAr65joif3vPSfsABtKs2uYIc/Y0N5xj82jrOd6fw7OjmrxJ2XcAEURhN0wVN3xSWh3oSCmnIJ3/jjpnWcXXm00TFqa3gb4NYF693KxFRnpedHtwwJDVDlMb7f2XDuisAaoRid/ZgutWQENAKtHPr74GIBYXSSG3GmjKV2eZUbwpiTHXmqFxfgu1u/DDD/zttW2fOS8VmWLYTEWzCuFczrw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1st9UA-0002NT-5r for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 13:38:02 -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, 24 Sep 2024 17:38:02 +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.17271994358983 (code B ref 73387); Tue, 24 Sep 2024 17:38:02 +0000 Original-Received: (at 73387) by debbugs.gnu.org; 24 Sep 2024 17:37:15 +0000 Original-Received: from localhost ([127.0.0.1]:59383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st9TL-0002Ke-PG for submit@debbugs.gnu.org; Tue, 24 Sep 2024 13:37:15 -0400 Original-Received: from forward502d.mail.yandex.net ([178.154.239.210]:47086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st9TI-0002KJ-GD for 73387@debbugs.gnu.org; Tue, 24 Sep 2024 13:37:10 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:1c19:0:640:2e7f:0]) by forward502d.mail.yandex.net (Yandex) with ESMTPS id 2A05D618ED; Tue, 24 Sep 2024 20:36:41 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id baX8GX1oD4Y0-NFqqHOSS; Tue, 24 Sep 2024 20:36:40 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1727199400; bh=fMRiArU6ShkrXoMWlKRvpQ6D8qAzDyjcOOHib5L1tDU=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=d5fJDr1egopCqtCGE1MI3BZlaR8qMWYU+wmbw7d7UxBs8/L/PCBttuyro5tONdG10 2xUOJoglLgEy1L/JJBXe+OKVCHo5XNFoEIcLTlwL3YlYWVx7iwwJvoJWkYR6q3yV2u +91eKBH/Qj/AGo8Nf0XxM2EgeMlfQe92eATOZ/hk= Authentication-Results: mail-nwsmtp-smtp-production-main-59.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfauth.phl.internal (Postfix) with ESMTP id 854B11200066; Tue, 24 Sep 2024 13:36:37 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 24 Sep 2024 13:36:37 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtfedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrd hruheqnecuggftrfgrthhtvghrnhepiefhjeeuveetffffvdefteffffekhfeuudejieeh heeiudelgfehgffffeduffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqddufeeffeelleehhedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvg igrdhruhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopeegpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrd hnrghmvgdprhgtphhtthhopehjuhhriheslhhinhhkohhvrdhnvghtpdhrtghpthhtohep jeeffeekjeesuggvsg X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Sep 2024 13:36:35 -0400 (EDT) Content-Language: en-US In-Reply-To: <87cykt2gkl.fsf@zephyr.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:292353 Archived-At: On 24/09/2024 18:54, Sean Whitton wrote: > On Tue 24 Sep 2024 at 09:32am +03, Juri Linkov wrote: > >>> But to really commit the narrowed diff I think you'll need to do >>> something about this line in vc-next-action >>> >>> ((eq model 'patch) >>> (vc-checkin files backend nil nil nil (buffer-string))) >>> >>> ...to specify altered buffer contents as the diff to use. >> What is altered buffer contents? Maybe widening is needed here as well? > Yeah, could you say more, please, Dmitry? > > What we basically want is a non-contiguous region, including the hunk > and the relevant file header. Are you thinking something like two > (BEG . END) pairs specifying that region? That's the question - what to do there (if be can), instead of passing the whole buffer string. Maybe it should call again some new function inside diff-mode package which would return an altered patch based on the current restrictions (but with file headers added). Simply calling 'widen' could counteract what seems like your intent. OTOH, maybe what you want to do here could be reached some other way - e.g. instead of 'C-x n n' we would have a command which edits the diff buffer to leave in only the hunks intersecting the current region. When the subsequent (buffer-string) would do the right thing. The latter might also be a better fit for the overall workflow we were thinking about (create a diff -> alter it as necessary -> commit).