parent
4347cc5277
commit
42a21dffdd
1 changed files with 5 additions and 2 deletions
|
@ -379,13 +379,16 @@ Set this to nil to disable incremental loading.")
|
|||
(defvar doom-incremental-idle-timer 0.75
|
||||
"How long (in idle seconds) in between incrementally loading packages.")
|
||||
|
||||
(defvar doom-incremental-load-immediately (daemonp)
|
||||
"If non-nil, load all incrementally deferred packages immediately at startup.")
|
||||
|
||||
(defun doom-load-packages-incrementally (packages &optional now)
|
||||
"Registers PACKAGES to be loaded incrementally.
|
||||
|
||||
If NOW is non-nil, load PACKAGES incrementally, in `doom-incremental-idle-timer'
|
||||
intervals."
|
||||
(if (not now)
|
||||
(nconc doom-incremental-packages packages)
|
||||
(appendq! doom-incremental-packages packages)
|
||||
(while packages
|
||||
(let ((req (pop packages)))
|
||||
(unless (featurep req)
|
||||
|
@ -415,7 +418,7 @@ intervals."
|
|||
"Begin incrementally loading packages in `doom-incremental-packages'.
|
||||
|
||||
If this is a daemon session, load them all immediately instead."
|
||||
(if (daemonp)
|
||||
(if doom-incremental-load-immediately
|
||||
(mapc #'require (cdr doom-incremental-packages))
|
||||
(when (numberp doom-incremental-first-idle-timer)
|
||||
(run-with-idle-timer doom-incremental-first-idle-timer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue