unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Dima Kogan <lists@dima.secretsauce.net>
Cc: 17544@debbugs.gnu.org
Subject: bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation
Date: Wed, 24 Feb 2016 13:33:03 +1100	[thread overview]
Message-ID: <87si0ion1c.fsf@gnus.org> (raw)
In-Reply-To: <87ha4jgw53.fsf@secretsauce.net> (Dima Kogan's message of "Wed, 21 May 2014 05:21:28 -0700")

Dima Kogan <lists@dima.secretsauce.net> 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





  reply	other threads:[~2016-02-24  2:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21 12:21 bug#17544: 24.3; [PATCH] Improved diff-mode navigation/manipulation Dima Kogan
2016-02-24  2:33 ` Lars Ingebrigtsen [this message]
2016-09-03  9:17   ` Dima Kogan
2016-09-03 10:14     ` Eli Zaretskii
2016-09-03 21:24       ` Dima Kogan
2016-09-04  3:27         ` npostavs
2016-09-07  7:14           ` Dima Kogan
2016-09-14 22:31             ` Dima Kogan
2016-09-23  7:22               ` Dima Kogan
2016-10-22 15:47                 ` npostavs
2016-10-23  1:44                   ` Dima Kogan
2016-10-23  2:49                     ` npostavs
2016-11-07  2:26                       ` Dima Kogan
2016-11-15  3:31                         ` npostavs
2016-11-17  4:15                           ` Dima Kogan
2016-11-17  4:33                             ` npostavs
2016-11-17  8:05                               ` Dima Kogan
2016-11-20  2:37                                 ` npostavs
2016-11-21  7:23                                   ` Dima Kogan
2016-11-23  0:42                                     ` npostavs
2016-11-23 21:11                                       ` Dima Kogan
2016-11-29  4:10                                         ` npostavs
2016-09-13  3:56           ` Dima Kogan
2016-09-03 11:05 ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87si0ion1c.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=17544@debbugs.gnu.org \
    --cc=lists@dima.secretsauce.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).