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: Fri, 27 Sep 2024 22:13:56 +0300 Message-ID: <5e956e3b-5891-401a-a898-e339f52ea307@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> 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="17285"; 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 Fri Sep 27 21:14:59 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 1suGQc-0004J3-Nt for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Sep 2024 21:14:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suGQG-0001Sv-IH; Fri, 27 Sep 2024 15:14:36 -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 1suGQE-0001Sc-9h for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 15:14:35 -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 1suGQD-0005hN-Ve for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 15:14:34 -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=PXFHxJ2cIs2bxvLHgaUPIobeZHSavnlEJQeg8L4gCVA=; b=mcP6RJ/leAiX/UjC7nJYs0UHDSuu9G7ZDEfdVrmClCpXbLOslHtcwhDmKwFNt33iJvXRyogCd+Vb3cEm8RwarHugzanZ1c2IDhyIO08QDkh3o+WxcbjFWfNIiyxd5t7sv9wHUdQb+COhBRhMCdlYagoQPsdU1a3lWbi7ZM/K/rPzSeiuL7CAvNcLQvMraXn/49Y5kZTnW06OqzxHMieJQlXMMMFQoSfwPgGH2hrc3sdT2rMTOApwbHzvI+0gtPOBJg/w65MNkaqKjCcvdw0iS7z0Alp3c66fiPf2/TwHMo/gjYomLknqWpZKtzJ8QHKcXhm8xytBbcLGXVKoSNfZpg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1suGQg-0001tW-Qa for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 15:15: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: Fri, 27 Sep 2024 19:15: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.17274644827183 (code B ref 73387); Fri, 27 Sep 2024 19:15:02 +0000 Original-Received: (at 73387) by debbugs.gnu.org; 27 Sep 2024 19:14:42 +0000 Original-Received: from localhost ([127.0.0.1]:49487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suGQM-0001rn-2b for submit@debbugs.gnu.org; Fri, 27 Sep 2024 15:14:42 -0400 Original-Received: from forward501d.mail.yandex.net ([178.154.239.209]:48850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suGQH-0001rK-Nj for 73387@debbugs.gnu.org; Fri, 27 Sep 2024 15:14:40 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:5da8:0:640:b4e9:0]) by forward501d.mail.yandex.net (Yandex) with ESMTPS id 638D06107F; Fri, 27 Sep 2024 22:14:05 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id 2Ecm9404TuQ0-wKsIeNrW; Fri, 27 Sep 2024 22:14:04 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1727464444; bh=PXFHxJ2cIs2bxvLHgaUPIobeZHSavnlEJQeg8L4gCVA=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=XcBj1cGXuJFXH+vIoU9/pHJoH9TzlIOHDVPgsc0UEzoX3ZLUn4sx5yBvxhnJJlg60 YxnG3GSaTsatoq9CA0ff6uzqZ2Emn4Ch43pVO7HdF9lcKS3TGM5ZhCeB2TEue8ETf/ +jtH0/2tA1MAz6wurS2foDpcVS8of1GeHT4Py+GA= Authentication-Results: mail-nwsmtp-smtp-production-main-92.myt.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 C997A1200043; Fri, 27 Sep 2024 15:14:01 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 27 Sep 2024 15:14:01 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtledgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughguhhtohhvseihrghnuggvgi drrhhuqeenucggtffrrghtthgvrhhnpeeihfejueevteffffdvfeetffffkefhuedujeei heehiedulefghefgffefudffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegughhuthhovhdomhgvshhmthhprghuthhhphgvrhhsohhnrghl ihhthidqudeffeefleelheehvddqvdelgeejjeejjeeiqdgughhuthhovheppeihrghnug gvgidrrhhusehfrghsthhmrghilhdrtghomhdpnhgspghrtghpthhtohepgedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepshhpfihhihhtthhonhesshhpfihhihhtthhonh drnhgrmhgvpdhrtghpthhtohepjeeffeekjeesuggvsggsuhhgshdrghhnuhdrohhrghdp rhgtphhtthhopehmoh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Sep 2024 15:13:59 -0400 (EDT) Content-Language: en-US In-Reply-To: <87y13dfgzz.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:292534 Archived-At: On 27/09/2024 14:55, Sean Whitton wrote: > Hello, > > On Thu 26 Sep 2024 at 02:46am +03, Dmitry Gutov wrote: > >> Suppose C-c C-n (or probably a different but similar binding) edited the diff >> instead of applying the narrowing, in a way that retained the file header(s), >> but keeping only the hunks intersecting the region or just the current one. >> >> Would that work for you just as well, or do you prefer to use narrowing >> anyway, for some other reasons? > > It would work for me, and has a few advantages: > > - it means you just hit 'g' afterwards, not C-x n w and then 'g' Yep. Or you could use 'undo' to get back to a previous state of the buffer. > - it fits better with our general paradigm of killing what you don't > want to include and then committing. > > On the other hand, it doesn't seem ideal that after C-c C-n you can, for > example, use C-c C-a or C-c M-k, but not C-x v v. That could break you > out of your mental flow. Fair point, and maybe we could support both. > What do you think about this: > > - add a command which does the kill-all-but-this-hunk (or hunks in > region if mark active) thing -- it's generally useful. > > - make C-x v v on a narrowed buffer, by default, issue a message saying > "Cannot commit patch when narrowed, consider " Or it would implement that previous alternative - using the modified buffer string that's limited to the current narrowing. I'm somewhat concerned about supporting both approaches (how different are the code paths going to be?), but if that's needed for usability, perhaps it's okay. > - add a user option that when non-nil means C-x v v on a narrowed buffer > automatically widens, invokes the new command, and then commits. And/or Emacs could by default prompt whether it should do that. And that prompting behavior could indeed be decided by a user option. > My thinking is that the latter behaviour is complex and so shouldn't be > the default, but once you understand what's going on then there is a > good chance you want to enable it. Maybe if the prompt is easy enough to understand, that will be fine...