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:
parent
6a140209b8
commit
09cb4f6716
93 changed files with 644 additions and 846 deletions
23
modules/ui/unicode/autoload.el
Normal file
23
modules/ui/unicode/autoload.el
Normal file
|
@ -0,0 +1,23 @@
|
|||
;;; ui/unicode/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'doom-post-init-hook #'+unicode|init-fonts)
|
||||
|
||||
;;;###autoload
|
||||
(defun +unicode|init-fonts ()
|
||||
"Set up `unicode-fonts' to eventually run; accomodating the daemon, if
|
||||
necessary."
|
||||
(setq-default bidi-display-reordering t
|
||||
doom-unicode-font nil)
|
||||
(if initial-window-system
|
||||
(+unicode|setup-fonts (selected-frame))
|
||||
(add-hook 'after-make-frame-functions #'+unicode|setup-fonts)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +unicode|setup-fonts (&optional frame)
|
||||
"Initialize `unicode-fonts', if in a GUI session."
|
||||
(when (and frame (display-graphic-p frame))
|
||||
(with-selected-frame frame
|
||||
(require 'unicode-fonts)
|
||||
;; NOTE will impact startup time on first run
|
||||
(unicode-fonts-setup))))
|
Loading…
Add table
Add a link
Reference in a new issue