casouri / vundo

Visualize the undo tree.
469 stars 23 forks source link

Setting to Unicode Fails in init #95

Closed chookity-pokk closed 11 months ago

chookity-pokk commented 11 months ago

In my init I have the (setq vundo-glyph-alist vundo-unicode-symbols) which fails and if I try evalutating it, it fails as well. Unless I run vundo and then evaluate it, then it works just fine. I then tried putting (vundo-mode) in my init before the setq command and that also fails. It seems like the issue is that until I call vundo I can't call vundo-mode or change the variables.

When I launch Emacs I have 4 vundo commands available in M-x, vundo, vundo-diff, vundo-diff-mark and vundo-diff-unmark. After calling vundo though I get 19 different commands. So it seems like somehow vundo isn't being loaded properly?

I am using Emacs 29.1 with the most up to date version of vundo.

jdtsmith commented 11 months ago

Did you (require 'vundo) or use a use-package equivalent? It loads automatically only upon invoking one of the auto-loaded commands, like M-x vundo. Here's how I load vundo:

(use-package vundo
  :bind ("C-?" . vundo)
  :custom
  (vundo-compact-display t)
  (vundo-glyph-alist vundo-unicode-symbols))
casouri commented 11 months ago

Just to give some context. Emacs has a lazy-loading feature, so that you don't need to load a package before you actually use it. The four commands you see are lazy-loaded, when they are invoked, Emacs loads vundo.el, and you now see the rest commands.

I just made vundo-unicode-symbols lazy-loaded too. So it'll be defined before vundo.el is loaded. In the meantime, you can set vundo-glyph-alist after loading vundo.el. If you use use-package, put it in :config.

chookity-pokk commented 11 months ago

Well shoot, sorry for the noise. I wasn't use a (require 'vundo) or use-package. Using either of those makes the command work. Thank you for the explanation about lazy loading, I didn't know that was a thing in Emacs!