Warn user to sync+rebuild on emacs' major version change

Byte-code is not generally compatible across major releases of Emacs,
and packages may have changed in that time. Best throw a more helpful
error than leave users to deal with the obscure errors that this can
cause.
This commit is contained in:
Henrik Lissner 2020-05-03 16:00:34 -04:00
parent 2ccb9cc8a3
commit 2c70b75c6c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 18 additions and 8 deletions

View file

@ -101,6 +101,8 @@ Return t on success, nil otherwise (but logs a warning)."
;; `string-remove-suffix' is much cheaper (because it does no file sanity
;; checks during or after; just plain ol' string manipulation).
(load (string-remove-suffix ".el" file) noerror 'nomessage)
(doom-error
(signal (car e) (cdr e)))
((debug error)
(message "Autoload file error: %s -> %s" (file-name-nondirectory file) e)
nil)))