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
|
@ -1,5 +1,11 @@
|
|||
;;; tools/prodigy/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(def-setting! :service (&rest plist)
|
||||
"TODO"
|
||||
`(after! prodigy
|
||||
(prodigy-define-service ,@plist)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +prodigy/create ()
|
||||
"Interactively create a new prodigy service."
|
||||
|
@ -32,3 +38,17 @@
|
|||
(file-directory-p (plist-get service :project)))
|
||||
collect service into services
|
||||
finally do (setq prodigy-service services)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +prodigy*services (orig-fn &rest args)
|
||||
"Adds a new :project property to prodigy services, which hides the service
|
||||
unless invoked from the relevant project."
|
||||
(let ((project-root (downcase (doom-project-root)))
|
||||
(services (apply orig-fn args)))
|
||||
(if current-prefix-arg
|
||||
services
|
||||
(cl-remove-if-not (lambda (service)
|
||||
(let ((project (plist-get service :project)))
|
||||
(or (not project)
|
||||
(file-in-directory-p project-root project))))
|
||||
services))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue