From 53eca4cfe65bb0a4d96f24871575629399d6d569 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 8 Sep 2023 12:54:20 +0200 Subject: 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. --- user/emacs/init.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'user/emacs') diff --git a/user/emacs/init.el b/user/emacs/init.el index dd4e8292..97a954f2 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -218,18 +218,21 @@ With two prefix arguments, write out the day and month name." (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 @@ _p_rev _u_pper _=_: upper/lower _r_esolve (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 - ""))) + "") + (evil-collection-init))) (general-create-definer my-leader-def :keymaps 'override @@ -599,14 +601,14 @@ _p_rev _u_pper _=_: upper/lower _r_esolve (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 (use-package tramp -- cgit 1.4.1