emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: diff-mode: C-c C-c fails when location of hunk has been changed. C-d


From: Stefan Monnier
Subject: Re: diff-mode: C-c C-c fails when location of hunk has been changed. C-d bound to backward-word.
Date: Mon, 26 May 2008 11:55:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> In diff mode, whilst on a hunk, do C-c C-c.  This fails to find the
> changed text in the target buffer, because it is now too far away from
> where it was.  Fair enough.

Hmm... actually, it does an unbounded search, so it should find a place
if one exists.  It may not be the right one, of course.  Could you give
a detailed recipe to reproduce the problem?

> Now edit the diff hunk so that the line number is now correct.  I.e.,
> change:

> *** 2078,2084 ****

> to

> *** 2128,2134 ****

> .  Now do C-c C-c again.  Point is left at L2078 in the target buffer,
> not L2128.  THIS IS A BUG.

Could be.  Depends on a lot of things.  E.g. are the from&to file
names identical?  Is point in the `from' or the `to' part of the hunk?
Is the location of the hunk found?  What does the hunk look like?

> #########################################################################

> Whilst in the diff mode buffer, type C-d here:

> *** 2078,2084 ****
>            ^

> The apparent effect of this is backward-word.  This is unfriendly.
> (What actually happens is that an after-command hook recalculates 2084
> and splats it into position.)

> I think it would be better if diff-mode beeped with a message, e.g.

> "End of hunk line-number cannot be edited".

IIRC the after-command hook tries to stay out of the way if you touch
any of the headers.  Indeed, it seems to DTRT for unified hunks, but not
for context ones.  I'll take a look at it.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]