From 6cb14c05b8ac68e9e881c14a2d8487a661c94c8c Mon Sep 17 00:00:00 2001
From: Joe Ardent <code@ardent.nebcorp.com>
Date: Sat, 4 Jan 2025 12:12:39 -0800
Subject: [PATCH] add fancier hook for undo-tree

---
 nebkor-emacs.org                    | 9 ++++++---
 nebkor-modules/nebkor-essentials.el | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/nebkor-emacs.org b/nebkor-emacs.org
index 2b24cc6..102f141 100644
--- a/nebkor-emacs.org
+++ b/nebkor-emacs.org
@@ -1507,9 +1507,12 @@ Open a nodal history graph in a new window to navigate all previous histories wi
 #+begin_src emacs-lisp :tangle "nebkor-modules/nebkor-essentials.el"
   (use-package undo-tree
     :ensure t
-    :init
-    (global-undo-tree-mode)
-    (blackout 'undo-tree-mode)
+    :config
+    (defun nebkor/undo-tree ()
+      (progn
+        (global-undo-tree-mode)
+        (blackout 'undo-tree-mode)))
+    :hook (elpaca-after-init . nebkor/undo-tree)
     :bind (("C-z" . undo)
            ("C-S-z" . redo)))
 #+end_src
diff --git a/nebkor-modules/nebkor-essentials.el b/nebkor-modules/nebkor-essentials.el
index 1097b10..4a72da1 100644
--- a/nebkor-modules/nebkor-essentials.el
+++ b/nebkor-modules/nebkor-essentials.el
@@ -210,9 +210,12 @@ If the region is selected, retain the original behaviour, otherwise call
 
 (use-package undo-tree
   :ensure t
-  :init
-  (global-undo-tree-mode)
-  (blackout 'undo-tree-mode)
+  :config
+  (defun nebkor/undo-tree ()
+    (progn
+      (global-undo-tree-mode)
+      (blackout 'undo-tree-mode)))
+  :hook (elpaca-after-init . nebkor/undo-tree)
   :bind (("C-z" . undo)
          ("C-S-z" . redo)))