From 6f1c0f7cc71ad64d4a79d2e6ccccd083c8b056ec Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 8 Aug 2022 18:52:32 +0200 Subject: [PATCH] fix: "symbol's value as variable is void: \213" error Some installs of Emacs do not come with byte-compiled versions of its bundled elisp files, so when loading them, Emacs falls back to loading its *.el.gz files. This would be fine if it were not for a startup optimization Doom employs, where it sets file-name-handler-alist to nil (and by doing so, robs Emacs of the ability to read compressed elisp). This causes "symbol's value as variable is void: \213" errors at startup. With this commit, Doom now disables this optimization early if it suspects this applies to your install. But time will tell if it's early enough. Ref: https://mail.gnu.org/archive/html/emacs-devel/2022-08/msg00234.html --- lisp/cli/autoloads.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/cli/autoloads.el b/lisp/cli/autoloads.el index d3952b698..9cf65a28d 100644 --- a/lisp/cli/autoloads.el +++ b/lisp/cli/autoloads.el @@ -45,6 +45,13 @@ one wants that.") (signal 'doom-error (list "The installed version of Doom has changed since last 'doom sync' ran" "Run 'doom sync' to bring Doom up to speed")))) + ;; If the bundled elisp for this Emacs install isn't byte-compiled, + ;; disengage the `file-name-handler-alist' optimization early to + ;; prevent encoding errors when Emacs tries to read gzipped elisp. + (unless (locate-file "startup.elc" (get 'load-path 'initial-value)) + `((unless noninteractive + (doom-reset-file-handler-alist-h) + (remove-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h 101)))) (cl-loop for var in doom-autoloads-cached-vars when (boundp var) collect `(set ',var ',(symbol-value var)))