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
17
modules/tools/rotate-text/autoload.el
Normal file
17
modules/tools/rotate-text/autoload.el
Normal file
|
@ -0,0 +1,17 @@
|
|||
;;; tools/rotate-text/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :rotate (modes &rest plist)
|
||||
"Declare :symbols, :words or :patterns (all lists of strings) that
|
||||
`rotate-text' will cycle through."
|
||||
(declare (indent 1))
|
||||
(let* ((modes (doom-enlist (doom-unquote modes)))
|
||||
(fn-name (intern (format "doom--rotate-%s" (mapconcat #'symbol-name modes "-")))))
|
||||
`(progn
|
||||
(defun ,fn-name ()
|
||||
(require 'rotate-text)
|
||||
(let ((plist (list ,@plist)))
|
||||
(setq rotate-text-local-symbols (plist-get plist :symbols)
|
||||
rotate-text-local-words (plist-get plist :words)
|
||||
rotate-text-local-patterns (plist-get plist :patterns))))
|
||||
(add-hook! ,modes #',fn-name))))
|
Loading…
Add table
Add a link
Reference in a new issue