mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-15 13:23:42 -05:00
Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
;;; feature/version-control/+git.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; These don't need `def-package!' blocks because they've already been set up by
|
||||
;; `doom-initialize'.
|
||||
(autoload 'gitconfig-mode "gitconfig-mode" nil t)
|
||||
(autoload 'gitignore-mode "gitignore-mode" nil t)
|
||||
|
||||
(when (featurep! :feature evil)
|
||||
(add-hook 'git-commit-mode-hook #'evil-insert-state))
|
||||
|
||||
@@ -59,7 +54,7 @@
|
||||
|
||||
|
||||
(def-package! git-timemachine
|
||||
:commands (git-timemachine git-timemachine-toggle)
|
||||
:defer t
|
||||
:config
|
||||
;; Sometimes I forget `git-timemachine' is enabled in a buffer, so instead of
|
||||
;; showing revision details in the minibuffer, show them in
|
||||
@@ -67,10 +62,6 @@
|
||||
(setq git-timemachine-show-minibuffer-details t)
|
||||
(advice-add #'git-timemachine--show-minibuffer-details :override #'+vcs*update-header-line)
|
||||
|
||||
;; Force evil to rehash keybindings for the current state
|
||||
(add-hook 'git-timemachine-mode-hook #'evil-force-normal-state))
|
||||
|
||||
|
||||
(def-package! git-link
|
||||
:commands (git-link git-link-commit git-link-homepage))
|
||||
|
||||
(after! evil
|
||||
;; Force evil to rehash keybindings for the current state
|
||||
(add-hook 'git-timemachine-mode-hook #'evil-force-normal-state)))
|
||||
|
Reference in New Issue
Block a user