From 2e92f8d8a89f04df4f99e145647fb5218f3aea0d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 19 Jun 2018 16:42:10 +0200 Subject: [PATCH] Keep backup of errant autoloads files --- core/core-dispatcher.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/core-dispatcher.el b/core/core-dispatcher.el index 53ce5453f..11cf9132f 100644 --- a/core/core-dispatcher.el +++ b/core/core-dispatcher.el @@ -342,16 +342,15 @@ it exists." (defun doom--byte-compile-file (file) (let ((short-name (file-name-nondirectory file)) (byte-compile-dynamic-docstrings t)) - (condition-case-unless-debug ex + (condition-case e (when (byte-compile-file file) (load (byte-compile-dest-file file) nil t) (unless noninteractive (message "Finished compiling %s" short-name))) - ('error + ((debug error) + (copy-file file (concat file ".bk") 'overwrite) (doom-delete-autoloads-file file) - (error "Error in %s: %s -- %s" - short-name - (car ex) (error-message-string ex)))))) + (signal 'doom-autoload-error (list short-name e)))))) (defun doom-reload-autoloads (&optional file force-p) "Reloads FILE (an autoload file), if it needs reloading.