From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation Date: Wed, 24 Feb 2016 13:33:03 +1100 Message-ID: <87si0ion1c.fsf@gnus.org> References: <87ha4jgw53.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456281328 28670 80.91.229.3 (24 Feb 2016 02:35:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Feb 2016 02:35:28 +0000 (UTC) Cc: 17544@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 24 03:35:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aYPIG-0002mn-OE for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Feb 2016 03:35:13 +0100 Original-Received: from localhost ([::1]:32944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYPIF-0005aS-E6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Feb 2016 21:35:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYPHn-0005RB-14 for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 21:35:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYPH8-0004Xp-NV for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 21:34:42 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYPH8-0004Xl-GJ for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 21:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aYPH8-0008GP-BV for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2016 21:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Feb 2016 02:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17544 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 17544-submit@debbugs.gnu.org id=B17544.145628121131722 (code B ref 17544); Wed, 24 Feb 2016 02:34:02 +0000 Original-Received: (at 17544) by debbugs.gnu.org; 24 Feb 2016 02:33:31 +0000 Original-Received: from localhost ([127.0.0.1]:41898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYPGd-0008FZ-Ap for submit@debbugs.gnu.org; Tue, 23 Feb 2016 21:33:31 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:58853) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYPGc-0008FS-4p for 17544@debbugs.gnu.org; Tue, 23 Feb 2016 21:33:30 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYPGF-0005eu-EZ; Wed, 24 Feb 2016 03:33:08 +0100 In-Reply-To: <87ha4jgw53.fsf@secretsauce.net> (Dima Kogan's message of "Wed, 21 May 2014 05:21:28 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aYPGF-0005eu-EZ MailScanner-NULL-Check: 1456885988.43817@qD5lwyS0Rq69oQwl3jtwUQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113631 Archived-At: Dima Kogan writes: > Navigation and use of diff buffers had several annoying corner cases that this > patch fixes. These corner cases were largely due to inconsistent treatment of > file headers. Say you have a diff such as this: > > --- aaa > +++ bbb > @@ -52,7 +52,7 @@ > hunk1 > @@ -74,7 +74,7 @@ > hunk2 > --- ccc > +++ ddd > @@ -608,6 +608,6 @@ > hunk3 > @@ -654,7 +654,7 @@ > hunk4 > > The file headers here are the '---' and '+++' lines. With the point on such a > line, hunk operations would sometimes refer to the next hunk and sometimes to > the previous hunk. Most of the time it would be the previous hunk, which is not > what the user would expect. This patch consistently treats such headers as the > next hunk. So with this patch, if the point is on the '--- ccc' line, the point > is seen as referring to hunk3. > > Specific behaviors this fixes are: > > 1. It should be possible to place the point in the middle of a diff buffer, and > press M-k repeatedly to kill hunks in the order they appear in the buffer. With > the point on hunk1, M-k M-k would kill hunk1 then hunk2. With the point on > hunk3, it would kill hunk3 then hunk4; this is fine. However, with the point on > hunk2, it'd kill hunk2 then hunk1. This is fixed by this patch. > > 2. Similarly, it should be possible to apply hunks in order. Previously with the > point at the start, C-c C-a would apply the hunk1, then move the point to the > first @@ header, and thus C-c C-a would try to apply the same hunk again. I think this makes sense, and the patch looks good to me. Does it still apply to the Emacs trunk? Anybody got any objections to installing it? It should also have an entry in NEWS, I think. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no