[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulat
From: |
Dima Kogan |
Subject: |
Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation |
Date: |
Sun, 11 Dec 2016 23:28:13 -0800 |
User-agent: |
mu4e 0.9.17; emacs 26.0.50.1 |
Dmitry Gutov <address@hidden> writes:
> On 10.12.2016 19:27, Dima Kogan wrote:
>
>> For the other concerns, I can special-case the last hunk, and move to
>> eob for diff-next, and to ding only if we're already at eob to begin
>> with.
Hi. I played around with this, and I now really don't like this idea
because it would mean that diff-hunk-next no longer always moves to the
next hunk. At the last hunk, diff-hunk-next would stay on the SAME hunk
if this was implemented. It would really make more sense if
- diff-hunk-next moves to next hunk
- if this isn't possible, the point stays where it is, and an error is
signalled
This is what the behavior in git intends to do.
Furthermore, I think invoking auto-refinement in diff-mode-hook makes
sense. The auto-refinement logic is written (not by me) to auto-refine
the hunk at point when it is visited. And this is triggered not just
with functions such as diff-hunk-next but also with actions such as
turning on auto-refine-mode: diff-auto-refine-mode refines the hunk at
point. Given this, I think it makes sense for us to do what
diff-auto-refine-mode does if we enter diff-mode and auto-refinement is
already on.
And I think that this should happen even if the first hunk is large.
This would indeed be slow, but this is AUTO refinement. If you want to
decide when refinement should or should not happen, auto-refinement is
not what you want. We can add a variable to block auto-refinement for
hunks larger than some size, which probably would be a good idea anyway.
I fixed the incorrect behavior where auto-refinement was kicking in even
when the navigation failed and we signalled an error.
Not attaching any patches yet. Let's agree on an approach, and then talk
implementation.
dima
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Mark Oteiza, 2016/12/05
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dima Kogan, 2016/12/09
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dmitry Gutov, 2016/12/10
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dima Kogan, 2016/12/10
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dmitry Gutov, 2016/12/11
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation,
Dima Kogan <=
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dmitry Gutov, 2016/12/15
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Tino Calancha, 2016/12/19
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dima Kogan, 2016/12/20
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dima Kogan, 2016/12/25
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Tino Calancha, 2016/12/25
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Tino Calancha, 2016/12/25
- Re: [Emacs-diffs] master 2c8a7e5: Improve diff-mode navigation/manipulation, Dmitry Gutov, 2016/12/25