all repos — nixfiles @ 53eca4cfe65bb0a4d96f24871575629399d6d569

System and user configuration, managed by nix and home-manager

emacs: avoid init errors interfering with basic functionality

after-init-hook doesn't get called if there's an init error, so it
shouldn't be used for critical functionality.
Alan Pearce alan@alanpearce.eu
Fri, 08 Sep 2023 12:54:20 +0200
commit

53eca4cfe65bb0a4d96f24871575629399d6d569

parent

0b7321bccc0a13e6ba26606180b8cabc14511650

1 files changed, 11 insertions(+), 9 deletions(-)

jump to
M user/emacs/init.eluser/emacs/init.el
@@ -218,18 +218,21 @@ :config (progn             (add-to-list 'savehist-additional-variables 'command-history)))
 
 (use-package persist-state
-  :if (bound-and-true-p server-process)
-  :ghook ('after-init-hook #'persist-state-mode))
+  :defer 1
+  :ghook ('server-mode-hook #'persist-state-mode))
 
 (use-package vertico
-  :ghook ('after-init-hook #'vertico-mode))
+  :config (progn
+            (vertico-mode +1)))
+
 (use-package prescient
   :defer 1
   :config (progn
             (setq prescient-history-length 10000)
             (prescient-persist-mode +1)))
+
 (use-package vertico-prescient
-  :after vertico
+  :after prescient
   :ghook '(vertico-mode-hook))
 
 (use-package marginalia
@@ -395,13 +398,12 @@ :config (global-anzu-mode +1)) 
 (use-package evil-collection
   :demand t
-  :commands (evil-collection-init)
-  :ghook ('after-init-hook #'evil-collection-init)
   :config (progn
             (setq evil-collection-magit-use-y-for-yank nil
                   evil-collection-want-company-extended-keybindings t)
             (general-unbind 'normal magit-mode-map
-              "<escape>")))
+              "<escape>")
+            (evil-collection-init)))
 
 (general-create-definer my-leader-def
   :keymaps 'override
@@ -599,13 +601,13 @@ auto-revert-use-notify t)             (global-auto-revert-mode t)))
 
 (use-package auto-sudoedit
-  :ghook ('after-init-hook #'auto-sudoedit-mode))
+  :defer 3
+  :config (auto-sudoedit-mode))
 
 (setq delete-by-moving-to-trash t)
 
 (use-package goto-chg
   :defer 1)
-
 
 ;;;; TRAMP