* RE: Jumping from one position to other position
2020-12-05 22:11 ` Michael Heerdegen
@ 2020-12-05 22:21 ` arthur miller
2020-12-05 22:54 ` Drew Adams
2020-12-07 6:50 ` Jean Louis
2020-12-05 23:38 ` Eric Abrahamsen
` (2 subsequent siblings)
3 siblings, 2 replies; 23+ messages in thread
From: arthur miller @ 2020-12-05 22:21 UTC (permalink / raw)
To: Michael Heerdegen, help-gnu-emacs@gnu.org
Would this be useful: to you guys?
https://www.emacswiki.org/emacs/VisibleBookmarks
https://github.com/joodland/bm
-------- Originalmeddelande --------
Från: Michael Heerdegen <michael_heerdegen@web.de>
Datum: 2020-12-05 23:12 (GMT+01:00)
Till: help-gnu-emacs@gnu.org
Ämne: Re: Jumping from one position to other position
Jean Louis <bugs@gnu.support> writes:
> If anybody have better way of jumping from one place A to place B and
> returning again to place A, and again to place B, let me know.
(1) Most obvious: Use two windows.
(2) Use registers. I've created "hotkeys" to save and restore 3
positions in 3 registers (I use registers A, B and C for that). One-key
sequences, of course, should that be. I chose H-kp-1, C-kp-1,
H-kp-2, ...
(3) A very smart "go to last change" package would ease that pain. I
once tried to implement something, but finding a good heuristic that
behaves well under different circumstances is surprisingly hard.
(2a) Instead of using registers, you can also use something that jumps
to the old position and stores the new one at the same time with one
command, a "switch between two places" command so to say. Implementing
something like that is obviously easy. I already did and am now using
(1) and (2) instead (probably because these are much more general tools,
so I have to remember less).
Regards,
Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: Jumping from one position to other position
2020-12-05 22:21 ` arthur miller
@ 2020-12-05 22:54 ` Drew Adams
2020-12-06 0:55 ` arthur miller
2020-12-07 6:50 ` Jean Louis
1 sibling, 1 reply; 23+ messages in thread
From: Drew Adams @ 2020-12-05 22:54 UTC (permalink / raw)
To: arthur miller, Michael Heerdegen, help-gnu-emacs
> Would this be useful: to you guys?
>
> https://urldefense.com/v3/__https://www.emacswiki.org/emacs/VisibleBook
> marks__;!!GqivPVa7Brio!ODGLJD76Thc3LdYv_ydFjyNk6oCSDgKQgztru60n9HlKf5Mz
> z6au_C1lSKZwcFX4$
>
> https://urldefense.com/v3/__https://github.com/joodland/bm__;!!GqivPVa7
> Brio!ODGLJD76Thc3LdYv_ydFjyNk6oCSDgKQgztru60n9HlKf5Mzz6au_C1lSAUW4iQP$
FWIW, Bookmark+ has the same ability - even easier.
Yes, you can navigate around using bookmarks. And
if they're autonamed then you don't need to name
them. And if they're highlighted you can see where
they are. And if they're temporary bookmarks you
don't need to worry about them getting saved when
you save bookmarks.
And, like markers, bookmarks move along with the
surrounding text as you edit.
^ permalink raw reply [flat|nested] 23+ messages in thread
* RE: Jumping from one position to other position
2020-12-05 22:54 ` Drew Adams
@ 2020-12-06 0:55 ` arthur miller
2020-12-06 2:06 ` Drew Adams
0 siblings, 1 reply; 23+ messages in thread
From: arthur miller @ 2020-12-06 0:55 UTC (permalink / raw)
To: Drew Adams, Michael Heerdegen, help-gnu-emacs@gnu.org
Drew, why am I not surprised Bookmark+ does that too? :-)
I am sorry I didn't recommend your library, I had a feeling you will come in and point out Bookmark+ can do it better; but I actually didn't know if it was applicable in this particular case.
By the way what FWIW stands for? For What I ...?
-------- Originalmeddelande --------
Från: Drew Adams <drew.adams@oracle.com>
Datum: 2020-12-05 23:54 (GMT+01:00)
Till: arthur miller <arthur.miller@live.com>, Michael Heerdegen <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
Ämne: RE: Jumping from one position to other position
> Would this be useful: to you guys?
>
> https://urldefense.com/v3/__https://www.emacswiki.org/emacs/VisibleBook
> marks__;!!GqivPVa7Brio!ODGLJD76Thc3LdYv_ydFjyNk6oCSDgKQgztru60n9HlKf5Mz
> z6au_C1lSKZwcFX4$
>
> https://urldefense.com/v3/__https://github.com/joodland/bm__;!!GqivPVa7
> Brio!ODGLJD76Thc3LdYv_ydFjyNk6oCSDgKQgztru60n9HlKf5Mzz6au_C1lSAUW4iQP$
FWIW, Bookmark+ has the same ability - even easier.
Yes, you can navigate around using bookmarks. And
if they're autonamed then you don't need to name
them. And if they're highlighted you can see where
they are. And if they're temporary bookmarks you
don't need to worry about them getting saved when
you save bookmarks.
And, like markers, bookmarks move along with the
surrounding text as you edit.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-05 22:21 ` arthur miller
2020-12-05 22:54 ` Drew Adams
@ 2020-12-07 6:50 ` Jean Louis
2020-12-07 19:41 ` Arthur Miller
1 sibling, 1 reply; 23+ messages in thread
From: Jean Louis @ 2020-12-07 6:50 UTC (permalink / raw)
To: arthur miller; +Cc: Michael Heerdegen, help-gnu-emacs@gnu.org
* arthur miller <arthur.miller@live.com> [2020-12-06 01:22]:
> Would this be useful: to you guys?
>
> https://www.emacswiki.org/emacs/VisibleBookmarks
>
> https://github.com/joodland/bm
That is great solution! That is exactly how it should be that user can
also visually see a point and quickly go back and forth.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-07 6:50 ` Jean Louis
@ 2020-12-07 19:41 ` Arthur Miller
2020-12-07 20:26 ` Jean Louis
0 siblings, 1 reply; 23+ messages in thread
From: Arthur Miller @ 2020-12-07 19:41 UTC (permalink / raw)
To: Jean Louis; +Cc: Michael Heerdegen, help-gnu-emacs@gnu.org
Jean Louis <bugs@gnu.support> writes:
> * arthur miller <arthur.miller@live.com> [2020-12-06 01:22]:
>> Would this be useful: to you guys?
>>
>> https://www.emacswiki.org/emacs/VisibleBookmarks
>>
>> https://github.com/joodland/bm
>
> That is great solution! That is exactly how it should be that user can
> also visually see a point and quickly go back and forth.
Cool, glad it suits you.
Consider checking Drew's Bookmark+ too. It does lot's of things, some of
which you might find useful! :-).
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-07 19:41 ` Arthur Miller
@ 2020-12-07 20:26 ` Jean Louis
0 siblings, 0 replies; 23+ messages in thread
From: Jean Louis @ 2020-12-07 20:26 UTC (permalink / raw)
To: Arthur Miller; +Cc: Michael Heerdegen, help-gnu-emacs@gnu.org
* Arthur Miller <arthur.miller@live.com> [2020-12-07 22:42]:
> Jean Louis <bugs@gnu.support> writes:
>
> > * arthur miller <arthur.miller@live.com> [2020-12-06 01:22]:
> >> Would this be useful: to you guys?
> >>
> >> https://www.emacswiki.org/emacs/VisibleBookmarks
> >>
> >> https://github.com/joodland/bm
> >
> > That is great solution! That is exactly how it should be that user can
> > also visually see a point and quickly go back and forth.
> Cool, glad it suits you.
>
> Consider checking Drew's Bookmark+ too. It does lot's of things, some of
> which you might find useful! :-).
I have it and just not currently using it.
The bm package I can maybe now use with Hyper key on Caps_Lock and I
get Caps Lock with shift Caps Lock.
For example I could then bind H-q to go back H-a to go forward or
maybe better H-a and H-s as it is maybe easier accessible.
clear lock
clear control
clear mod1
clear mod2
clear mod3
clear mod4
clear mod5
keycode 66 = Hyper_L Caps_Lock
keycode 108 = Alt_R
add control = Control_L Control_R
add mod1 = Alt_L Alt_R Meta_L
add mod2 = Num_Lock
add mod3 = Hyper_L
add mod4 = Super_L Super_R
add mod5 = Mode_switch ISO_Level3_Shift
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-05 22:11 ` Michael Heerdegen
2020-12-05 22:21 ` arthur miller
@ 2020-12-05 23:38 ` Eric Abrahamsen
2020-12-06 0:12 ` Michael Heerdegen
2020-12-06 5:41 ` Jean Louis
2020-12-06 9:13 ` Marcin Borkowski
3 siblings, 1 reply; 23+ messages in thread
From: Eric Abrahamsen @ 2020-12-05 23:38 UTC (permalink / raw)
To: help-gnu-emacs
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Jean Louis <bugs@gnu.support> writes:
>
>> If anybody have better way of jumping from one place A to place B and
>> returning again to place A, and again to place B, let me know.
>
> (1) Most obvious: Use two windows.
>
> (2) Use registers. I've created "hotkeys" to save and restore 3
> positions in 3 registers (I use registers A, B and C for that). One-key
> sequences, of course, should that be. I chose H-kp-1, C-kp-1,
> H-kp-2, ...
>
> (3) A very smart "go to last change" package would ease that pain. I
> once tried to implement something, but finding a good heuristic that
> behaves well under different circumstances is surprisingly hard.
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?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-05 23:38 ` Eric Abrahamsen
@ 2020-12-06 0:12 ` Michael Heerdegen
2020-12-06 3:42 ` Eric Abrahamsen
0 siblings, 1 reply; 23+ messages in thread
From: Michael Heerdegen @ 2020-12-06 0:12 UTC (permalink / raw)
To: help-gnu-emacs
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.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-06 0:12 ` Michael Heerdegen
@ 2020-12-06 3:42 ` Eric Abrahamsen
2020-12-06 11:51 ` Stefan Möding
2020-12-06 23:06 ` Michael Heerdegen
0 siblings, 2 replies; 23+ messages in thread
From: Eric Abrahamsen @ 2020-12-06 3:42 UTC (permalink / raw)
To: help-gnu-emacs
Michael Heerdegen <michael_heerdegen@web.de> writes:
> 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.
Wow, that does sound hairy. I've never wanted anything but to go to the
previous change (a command I'm off to implement now using
`buffer-undo-list'), so I expect less frustration.
I also really like your idea of "hotkeys" for a few register positions
-- I love registers and use them as much as I can, but the keybindings
do feel cumbersome.
> 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.
I assume you've tried undo-tree, too...
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-06 3:42 ` Eric Abrahamsen
@ 2020-12-06 11:51 ` Stefan Möding
2020-12-06 18:15 ` Eric Abrahamsen
2020-12-06 23:06 ` Michael Heerdegen
1 sibling, 1 reply; 23+ messages in thread
From: Stefan Möding @ 2020-12-06 11:51 UTC (permalink / raw)
To: help-gnu-emacs
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> Wow, that does sound hairy. I've never wanted anything but to go to the
> previous change (a command I'm off to implement now using
> `buffer-undo-list'), so I expect less frustration.
I’ve used the "goto-chg" package (it’s on MELPA) occasionally. There is
also an entry on the Emacs Wiki concerning this topic:
https://www.emacswiki.org/emacs/GotoChg
--
Stefan
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-06 11:51 ` Stefan Möding
@ 2020-12-06 18:15 ` Eric Abrahamsen
2020-12-06 23:07 ` Michael Heerdegen
0 siblings, 1 reply; 23+ messages in thread
From: Eric Abrahamsen @ 2020-12-06 18:15 UTC (permalink / raw)
To: Stefan Möding; +Cc: help-gnu-emacs
Stefan Möding <s.moeding@gmail.com> writes:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Wow, that does sound hairy. I've never wanted anything but to go to the
>> previous change (a command I'm off to implement now using
>> `buffer-undo-list'), so I expect less frustration.
>
> I’ve used the "goto-chg" package (it’s on MELPA) occasionally. There is
> also an entry on the Emacs Wiki concerning this topic:
>
> https://www.emacswiki.org/emacs/GotoChg
There's nothing you can think of doing with Emacs that doesn't already
have a package for doing it :) That's really an amazing amount of code,
though.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-06 3:42 ` Eric Abrahamsen
2020-12-06 11:51 ` Stefan Möding
@ 2020-12-06 23:06 ` Michael Heerdegen
1 sibling, 0 replies; 23+ messages in thread
From: Michael Heerdegen @ 2020-12-06 23:06 UTC (permalink / raw)
To: help-gnu-emacs
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> I assume you've tried undo-tree, too...
I like it and use it and also hacked it a bit. Too bad the author had
not much time recently.
It's a bit hard to hack it. For example, the time stamps of the
entries. They get updated whenever you only look at the according
entry. Sooner or later it gets a mess. It's hard to change things like
that. I think there is room for improving the user interface.
Regards,
Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-05 22:11 ` Michael Heerdegen
2020-12-05 22:21 ` arthur miller
2020-12-05 23:38 ` Eric Abrahamsen
@ 2020-12-06 5:41 ` Jean Louis
2020-12-06 23:11 ` Michael Heerdegen
2020-12-06 9:13 ` Marcin Borkowski
3 siblings, 1 reply; 23+ messages in thread
From: Jean Louis @ 2020-12-06 5:41 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
* Michael Heerdegen <michael_heerdegen@web.de> [2020-12-06 01:12]:
> Jean Louis <bugs@gnu.support> writes:
>
> > If anybody have better way of jumping from one place A to place B and
> > returning again to place A, and again to place B, let me know.
>
> (1) Most obvious: Use two windows.
>
> (2) Use registers. I've created "hotkeys" to save and restore 3
> positions in 3 registers (I use registers A, B and C for that). One-key
> sequences, of course, should that be. I chose H-kp-1, C-kp-1,
> H-kp-2, ...
>
> (3) A very smart "go to last change" package would ease that pain. I
> once tried to implement something, but finding a good heuristic that
> behaves well under different circumstances is surprisingly hard.
Maybe I just do not know how to use built-in functions like C-SPC
C-SPC to leave mark, I use it all the time, but maybe I miss
something.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-06 5:41 ` Jean Louis
@ 2020-12-06 23:11 ` Michael Heerdegen
0 siblings, 0 replies; 23+ messages in thread
From: Michael Heerdegen @ 2020-12-06 23:11 UTC (permalink / raw)
To: help-gnu-emacs
Jean Louis <bugs@gnu.support> writes:
> Maybe I just do not know how to use built-in functions like C-SPC
> C-SPC to leave mark, I use it all the time, but maybe I miss
> something.
What do you do when you need the mark for, well, marking, because you
need to copy and paste between the two positions?
Using the mark reminds me of the more general concept of the
global-mark-ring, with a bit of tuning one can also use it to find back
to recent positions conveniently, even across buffers.
Regards,
Michael.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Jumping from one position to other position
2020-12-05 22:11 ` Michael Heerdegen
` (2 preceding siblings ...)
2020-12-06 5:41 ` Jean Louis
@ 2020-12-06 9:13 ` Marcin Borkowski
3 siblings, 0 replies; 23+ messages in thread
From: Marcin Borkowski @ 2020-12-06 9:13 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
On 2020-12-05, at 23:11, Michael Heerdegen <michael_heerdegen@web.de> wrote:
> Jean Louis <bugs@gnu.support> writes:
>
>> If anybody have better way of jumping from one place A to place B and
>> returning again to place A, and again to place B, let me know.
> (2) Use registers. I've created "hotkeys" to save and restore 3
This. Also, avy.
Hth,
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 23+ messages in thread