Subject: bug#36526: 26.2; Open diff at current location (feature request with suggested code)

From: Campbell Barton <[email-masked]>
Date: Wed, 06 Nov 2019 22:15:19 +1100

On Sat, 2019-11-02 at 02:02 +0100, Stefan Kangas wrote:
> Stefan Kangas <[email-masked]> writes:
> 
> >> Would someone be able to check the code and see if it's going in
> the
> >> right direction?
> >
> > OK, but see below.
> >
> >> >> This is a feature suggestion which I've written example code
> for
> >> >>
> >> >> `vc-root-diff` (or a new function), could jump to the closest
> line.
> >> >>
> >> >> This is useful since you move to the context of the current
> line.
> >
> > I'm not sure I understand what this code is supposed to do or how
> to
> > use it. Could you please give a recipe for how to test it?
> 
> Hi Campbell,
> 
> Just to follow up on this, could you please provide instructions for
> how to test your patch?
> 
> Thanks in advance.
> 
> Best regards,
> Stefan Kangas

Hi Stefan,

I've updated the Q&A to include the code and a utility function to use
it:

https://emacs.stackexchange.com/a/51439/2418

Try binding "vc-root-diff-fullscreen-and-jump-to-point" from a key in a
git repository with local edits, this will open the diff at (or close
to) the location being edited.

Included example video, showing how this is useful:

https://youtu.be/hbD8WrtWfEg