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
|
(defvar doom-incremental-idle-timer 0.75
|
||||||
"How long (in idle seconds) in between incrementally loading packages.")
|
"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)
|
(defun doom-load-packages-incrementally (packages &optional now)
|
||||||
"Registers PACKAGES to be loaded incrementally.
|
"Registers PACKAGES to be loaded incrementally.
|
||||||
|
|
||||||
If NOW is non-nil, load PACKAGES incrementally, in `doom-incremental-idle-timer'
|
If NOW is non-nil, load PACKAGES incrementally, in `doom-incremental-idle-timer'
|
||||||
intervals."
|
intervals."
|
||||||
(if (not now)
|
(if (not now)
|
||||||
(nconc doom-incremental-packages packages)
|
(appendq! doom-incremental-packages packages)
|
||||||
(while packages
|
(while packages
|
||||||
(let ((req (pop packages)))
|
(let ((req (pop packages)))
|
||||||
(unless (featurep req)
|
(unless (featurep req)
|
||||||
|
@ -415,7 +418,7 @@ intervals."
|
||||||
"Begin incrementally loading packages in `doom-incremental-packages'.
|
"Begin incrementally loading packages in `doom-incremental-packages'.
|
||||||
|
|
||||||
If this is a daemon session, load them all immediately instead."
|
If this is a daemon session, load them all immediately instead."
|
||||||
(if (daemonp)
|
(if doom-incremental-load-immediately
|
||||||
(mapc #'require (cdr doom-incremental-packages))
|
(mapc #'require (cdr doom-incremental-packages))
|
||||||
(when (numberp doom-incremental-first-idle-timer)
|
(when (numberp doom-incremental-first-idle-timer)
|
||||||
(run-with-idle-timer 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