From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton 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: Wed, 25 Sep 2024 07:34:51 +0100 Message-ID: <87jzf01bsk.fsf@zephyr.silentflame.com> 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 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17453"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 73387@debbugs.gnu.org, monnier@iro.umontreal.ca, Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 25 08:35:58 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 1stLcz-0004N7-JU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Sep 2024 08:35:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stLch-0003ro-4x; Wed, 25 Sep 2024 02:35: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 1stLcf-0003rO-5W for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 02:35:37 -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 1stLce-0000In-SV for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 02:35:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=4675FyLJAJT6Q1D1ulJSmK/puqPj+/C1HXTeXLmJD2U=; b=kDp1qLHuVHoHoMGvICmGKfZbCiaGFx4woule8V6L/A6GCTrv7J1rE6mw/3EdIAsdxs/PQFVigFdDwi4PYYgMpZTizR3C5h2RBoQOb8HGRmNu+gfOxSv2Dc77gkN/pBI/S+xn3/88WfgrhV43XUFSnGB+HsMLIiBgI+kCRpBU2qFY5klNYKDBHmbEzHMtKb4kYWPAhIY+2bAT6Yp8o6NUVeEmMi5fCGanOHwbnhiEJc2oQOxzhJcUathIJPJaz54/3QKcjNxYBzZIUr685gdeG7iJNgzAZAS9V/EnLh9qMHa67rukv1XQgkMjc1KAMdCQ5PMXhO1LUZM6cMjDy5WSuA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stLd3-0006qg-U9 for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 02:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Sep 2024 06:36: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.172724613626273 (code B ref 73387); Wed, 25 Sep 2024 06:36:01 +0000 Original-Received: (at 73387) by debbugs.gnu.org; 25 Sep 2024 06:35:36 +0000 Original-Received: from localhost ([127.0.0.1]:42816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stLcd-0006pg-Pg for submit@debbugs.gnu.org; Wed, 25 Sep 2024 02:35:36 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]:42686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stLca-0006hW-El for 73387@debbugs.gnu.org; Wed, 25 Sep 2024 02:35:34 -0400 DKIM-Signature: a=rsa-sha256; b=fpHe1r9w/z61pXMF5DS4cxaWtM7+y04EkhYiLPgOF8Qv0rBm2g9+Nvr4i0zKT3Hh6DyRi73L3Dauk2BWdAou60oTAIij+QDF20CXuA+PNAPvt+eLIXy6Q0KmVoR5drummdPUJmcg7NNdU7UI1uIpwnVDGspU5skqdsZiIkDA9a2KuOmlDiN9519W973SCE9EE7n1O6YfG0WddOl7dxh4EWkfgV97MTep8O3BkFJmfGUyv2aOcYHfvR3slAAuRWyLAEpnbcg6DfDDxUjmIdLMf2eAomleCtx7ZjAUHJnpEXhv7ytur7bUkgdubMlSKPHM57EcDScDMty/cZG2tAMvRw==; s=purelymail1; d=spwhitton.name; v=1; bh=mOiWcQl8NxWDZsCWqYG+PPvqU3VEHUbWtNrx7qfcl9c=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=QCnvKCfXixb0shmIG/bLA2NjLNdDrSmq/i36/mdcmDVuaFNFJk7ex27bm2EA5mDAhL204SPdhFP+qdHZE70rwQ0tPncKffakIqTs+aWHhHwfwUBNfNvFSOK0lJ3TbtIDGI3ioHgzWTTYLM35npP7nfbjTv++pzXq1JBHfjYvZnzwo1s1znb2v2J8OB2FOra6ps70IAbHzOMJJLVumC02z5dK4Q1n0VeK6fE7iygvBmFmPf35JWS9aKjKG1e8uhsDyxSAFjAkNH5qrohMFoItn0y2SfXSvQneAxqxg3hBRxMAbRX8Z2wXKPJA7U275aYkQvgBR1U+hy/yr3ufMRs6mA==; s=purelymail1; d=purelymail.com; v=1; bh=mOiWcQl8NxWDZsCWqYG+PPvqU3VEHUbWtNrx7qfcl9c=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 73387@debbugs.gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1772134037; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 25 Sep 2024 06:34:52 +0000 (UTC) Original-Received: by zephyr.silentflame.com (Postfix, from userid 1000) id C5088949F2A; Wed, 25 Sep 2024 07:34:51 +0100 (BST) In-Reply-To: (Dmitry Gutov's message of "Tue, 24 Sep 2024 20:36:32 +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:292378 Archived-At: Hello, On Tue 24 Sep 2024 at 08:36pm +03, Dmitry Gutov wrote: > 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). Yeah, I already wrote something like that for my init.el. I would like to find some way to combine it with the existing C-c C-n, if we can. Maybe: if (equal (diff-bounds-of-hunk) (list (point-min) (point-max)), then C-x v v prompts, "Kill all hunks but this one and commit? (y/n)" ? Else if the buffer is narrowed, C-x v v signals a user-error that it can't handle arbitrary narrowings. Then it's just C-c C-n C-x v v but you're asked to confirm before all the killing occurs, just in case. -- Sean Whitton