help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Jumping from one position to other position


From: Michael Heerdegen
Subject: Re: Jumping from one position to other position
Date: Sun, 06 Dec 2020 01:12:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I've often wanted this, and sometimes end up using undo-plus-redo
> to get there. It only just occurred to me that `buffer-undo-list' has
> all this information -- was that what you used? What difficulties did
> you run into?

Yes, that works, it's perfect data, that's not the problem.

If have typed, say, 4 lines somewhere, you have to call the command a
lot of times until it jumps to some other place.  Not practical (I always
ended up having hit the key one time too often.  Makes you angry).

Then you can say, ok, just go to any line once.  Until you have inserted
something with lots of lines, and it visits most of them. 

Then you try to improve your heuristic further, and there's always a
situation where it is impossible to jump back to some place you want to
because the heuristic sorted it out, e.g. because it's directly next to
some other change or so.  I then used a prefix arg so that the user
could soften the heuristic explicitly, but then I noted that it's
simpler to use registers and other tools that are at least no heuristic
based black boxes.

I've also tried the non-chronological approach - visit changes in
position order - but I also didn't like it.

When I'm looking for older changes, I use Magit Wip mode with Ediff, to
display the changes of the last n minutes.  After exiting Ediff I can
hit a key to go to the line according to the latest selected diff.  For
shorter time periods I use registers now.

Michael.




reply via email to

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