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
parent d443488728
commit 2bce9dbc1a
No known key found for this signature in database
GPG Key ID: B60957CA074D39A3

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)
"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
`emacs-startup-hook'.")
@ -222,7 +222,7 @@ intervals."
(condition-case-unless-debug e
(and
(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
(while-no-input
(doom-log "start:iloader: Loading %s (%d left)" req (length packages))