fix: doom-incremental-first-idle-timer: type error when nil

If the user uses the doom-load-packages-incrementally function directly,
and has set doom-incremental-first-idle-timer set to nil, it will throw
a type error.

Close: #7710
This commit is contained in:
Henrik Lissner 2024-03-05 15:57:31 -05:00 committed by Yann Esposito (Yogsototh)
parent 1cf2f2d52d
commit 5fb7dd6dfa
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -199,7 +199,7 @@ in daemon sessions (they are loaded immediately at startup).")
(defvar doom-incremental-first-idle-timer (if (daemonp) 0 2.0) (defvar doom-incremental-first-idle-timer (if (daemonp) 0 2.0)
"How long (in idle seconds) until incremental loading starts. "How long (in idle seconds) until incremental loading starts.
Set this to nil to disable incremental loading. Set this to nil to disable incremental loading at startup.
Set this to 0 to load all incrementally deferred packages immediately at Set this to 0 to load all incrementally deferred packages immediately at
`emacs-startup-hook'.") `emacs-startup-hook'.")
@ -222,7 +222,7 @@ intervals."
(condition-case-unless-debug e (condition-case-unless-debug e
(and (and
(or (null (setq idle-time (current-idle-time))) (or (null (setq idle-time (current-idle-time)))
(< (float-time idle-time) doom-incremental-first-idle-timer) (< (float-time idle-time) (or doom-incremental-first-idle-timer 0.0))
(not (not
(while-no-input (while-no-input
(doom-log "start:iloader: Loading %s (%d left)" req (length packages)) (doom-log "start:iloader: Loading %s (%d left)" req (length packages))