fix(lib): ignore doom-compile-functions failures

It really isn't important if this function succeeds or not, but it seems
its stability is highly variable, dependent on your specific build and
version of Emacs. Since there are a lot of 29 Doom users, best to be
more permissive and simply fall back to byte-compilation if native-comp
fails.
This commit is contained in:
Henrik Lissner 2022-09-16 18:54:22 +02:00
parent 58c0de6841
commit 3ba56eb008
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -253,14 +253,14 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
"Queue FNS to be byte/natively-compiled after a brief delay."
(with-memoization (get 'doom-compile-function 'timer)
(run-with-idle-timer
1 t (fn! (when-let ((fn (pop fns))
1.5 t (fn! (when-let ((fn (pop fns))
(fndef (indirect-function fn)))
(if (featurep 'native-compile)
(unless (subr-native-elisp-p fndef)
(doom-log "native-compile: Compiling %s" fn)
(native-compile fn))
(unless (byte-code-function-p fndef)
(doom-log "byte-compile: Compiling %s" fn)
(doom-log "compile-functions: %s" fn)
(or (if (featurep 'native-compile)
(or (subr-native-elisp-p fndef)
(ignore-errors (native-compile fn))))
(byte-code-function-p fndef)
(let (byte-compile-warnings)
(byte-compile fn))))
(unless fns
(cancel-timer (get 'doom-compile-function 'timer))