diff options
author | Alan Pearce | 2023-09-08 12:54:20 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-08 12:54:20 +0200 |
commit | 53eca4cfe65bb0a4d96f24871575629399d6d569 (patch) | |
tree | 2a2f1b8321d56949b4961c3c3c17f65bf3f40a1d /user | |
parent | 0b7321bccc0a13e6ba26606180b8cabc14511650 (diff) | |
download | nixfiles-53eca4cfe65bb0a4d96f24871575629399d6d569.tar.lz nixfiles-53eca4cfe65bb0a4d96f24871575629399d6d569.tar.zst nixfiles-53eca4cfe65bb0a4d96f24871575629399d6d569.zip |
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.
Diffstat (limited to 'user')
-rw-r--r-- | user/emacs/init.el | 20 |
1 files changed, 11 insertions, 9 deletions
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 - "<escape>"))) + "<escape>") + (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 |