vundo icon indicating copy to clipboard operation
vundo copied to clipboard

vundo as popup for normal undo/redo

Open ghost opened this issue 10 months ago • 3 comments

Hello,

I want to share an idea I've implemented for myself because the result feels very convenient.

I made it so that the "normal" undo/redo commands cause the vundo window to popup silently (at the usual position), but I don't select it. The buffer stays writeable, subsequent undo/redo commands force the update the popup. If I do something else, the popup window is silently closed after a short timeout (default: 3 seconds). But I can also switch to the popup, which then becomes automatically updated (very important) and becomes the usual fully functional vundo thing.

This is nice: most of the time, I don't need vundo, but it's nice as a visualisation. But when I need it, I often realize too late. Then I call vundo but fail to see quickly where I came from (which undo node). This way I always see what I do and keep my normal keys, I don't interrupt my workflow until it gets really complicated (branch points etc) - and then I switch to the already existing vundo window. Of course, the vundo command still works as well, just like before.

What I currently have is only a hack (vundo makes the buffer read-only, etc, some workarounds needed to get it work nicely) but believe me, for some users (like me) this is a quite nice thing.

If you are not interested just close the issue anyway. Have a nice day, thanks for reading,

Michael.

ghost avatar Feb 08 '25 00:02 ghost

Hey Michael, it sounds like a fun idea :) If you want to create a new file and add a minor mode that implements what you said (vundo-follow-mode?), I'll gladly merge it.

However, since vundo is in ELPA, you do need to sign the GNU copyright assignment. It's like contributing to Emacs core directly, since ELPA is considered part of the Emacs project. If you don't have the copyright assignment and is willing to sign it, just shoot an email to [email protected] saying that you want the sign the assignment, and someone will send you all the info you need.

casouri avatar Feb 08 '25 07:02 casouri

Yuan Fu @.***> writes:

Hey Michael, it sounds like a fun idea :) If you want to create a new file and add a minor mode that implements what you said (vundo-follow-mode?), I'll gladly merge it.

Ok, will try. Note that the result will necessarily be a bit hackish because I need to work around some hardcoded behavior - like vundo making the original buffer read-only. But let's at least start like that.

However, since vundo is in ELPA, you do need to sign the GNU copyright assignment [...]

Fortunately I had done that long ago. See the sporadic commits of me in the Emacs repo itself for verification (or ask Eli).

ghost avatar Feb 09 '25 03:02 ghost

Awesome! Let's start with your hacks, then I can look into modifying vundo so your mode doesn't need the hacks.

casouri avatar Feb 12 '25 04:02 casouri