From 3ba56eb00883044ad8d9e8c9a0f7cee40b34ae1a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 Sep 2022 18:54:22 +0200 Subject: [PATCH] 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. --- lisp/doom-lib.el | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index 963778e61..11a185fea 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -253,18 +253,18 @@ 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)) - (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) - (byte-compile fn)))) - (unless fns - (cancel-timer (get 'doom-compile-function 'timer)) - (put 'doom-compile-function 'timer nil)))))) + 1.5 t (fn! (when-let ((fn (pop fns)) + (fndef (indirect-function 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)) + (put 'doom-compile-function 'timer nil)))))) ;;