vundo icon indicating copy to clipboard operation
vundo copied to clipboard

vundo-box (displaying vundo like eldoc-box)

Open gs-101 opened this issue 1 year ago • 8 comments

I seet that you're also the creator of eldoc-box (love this package, btw), and, when trying out Neomacs, I noticed they have an undo system similar to the one found on this package, but it's not displayed at the bottom:

07:42 AM 13-12-2024

Would it be possible to make an option to display vundo in a childframe, like how it's done in eldoc-box?

gs-101 avatar Dec 13 '24 10:12 gs-101

Hey sorry for the late reply. Do you want to display the undo tree in a childframe, or display the undo tree vertically?

casouri avatar Dec 24 '24 02:12 casouri

Hey sorry for the late reply. Do you want to display the undo tree in a childframe, or display the undo tree vertically?

In a childframe.

gs-101 avatar Dec 24 '24 09:12 gs-101

Shouldn't be hard to make it configurable. Let me see.

casouri avatar Dec 25 '24 09:12 casouri

Ok, now you should be able to configure how to display the vundo buffer by adding an entry todisplay-buffer-alist. You can use display-buffer-in-child-frame.

casouri avatar Dec 26 '24 01:12 casouri

Thank! I'll test it right away.

gs-101 avatar Dec 26 '24 01:12 gs-101

Ah, forgot to ask, to what function should I set display-buffer-in-child-frame to?

I tried:

(add-to-list 'display-buffer-alist '(vundo-1 (display-buffer-in-child-frame)))

But that broke buffer display.

gs-101 avatar Dec 26 '24 01:12 gs-101

Hey sorry, didn't see you second message. You should use something like

(add-to-list 'display-buffer-alist
             `(" *vundo tree*"
               display-buffer-in-child-frame
               (child-frame-parameters . ((undecorated . t)
                                          (menu-bar-lines . 0)
                                          (internal-border-width . 1)
                                          (tool-bar-lines . 0)
                                          (vertical-scroll-bars . nil)
                                          (horizontal-scroll-bars . nil)
                                          (tab-bar-lines . 0)
                                          (mouse-wheel-frame . nil)
                                          ))))

But you probably want to use something like posframe to handle the details (all the childframe parameters and positioning) for you.

casouri avatar Jan 08 '25 06:01 casouri

Thanks. I was going to report to you that it didn't work, then I noticed I actually had the stable version (2.3.0) installed for all this time.

(add-to-list 'display-buffer-alist
               `("\\*vundo tree\\*"
                 display-buffer-in-child-frame
                 (child-frame-parameters . ((undecorated . t)
                                            (menu-bar-lines . 0)
                                            (internal-border-width . 1)
                                            (tool-bar-lines . 0)
                                            (vertical-scroll-bars . nil)
                                            (horizontal-scroll-bars . nil)
                                            (tab-bar-lines . 0)
                                            (mouse-wheel-frame . nil)
                                            ))))

It works, but since it's a child-frame I can't exactly interact with it. I'll try it out with a posframe:

(add-to-list 'display-buffer-alist
               `("\\*vundo tree\\*"
                 posframe-show
                 :poshandler #'posframe-poshandler-frame-top-right-corner))

And, again, it displays in correctly (a posframe), but I can't interact with it.

I was going to send a video, but OBS just keeps dying on me, so here are some screenshots:

Childframe

scratch - GNU Emacs at nobara-pc 08:37 PM 08-01-2025

The vundo frame covers the area highlighted in red. As shown by the Typing... from keycast, I can't use the Vundo commands (f to go fowrads, b...) and instead I just type regularly in the buffer.

Posframe

Backtrace - GNU Emacs at nobara-pc 08:45 PM 08-01-2025

Way smaller. It doesn't display in the top right (but I kind of like that, actually), but I once again can't interact with it.

There's also a window-live-p error.

gs-101 avatar Jan 08 '25 23:01 gs-101