From dca4015003c80fcc18057b1f2ee586e4d8643c9b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 27 Oct 2019 14:27:29 -0400 Subject: [PATCH] Fix void-variable themes error at startup If lexical-binding isn't enabled (with ';; -*- lexical-binding: t; -*-' at the top of your private config), custom-set-theme! and custom-theme-set-faces! throw this error. Since these macros are commonly used in user configs, where I can't police lexical-binding, I've refactored it to not rely on it. --- core/autoload/themes.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/autoload/themes.el b/core/autoload/themes.el index 8a85d2d11..363c4b33c 100644 --- a/core/autoload/themes.el +++ b/core/autoload/themes.el @@ -16,11 +16,10 @@ THEME can be a single symbol or list thereof. If nil, apply these settings to all themes. It will apply to all themes once they are loaded." (declare (indent defun)) - `(let* ((themes (doom-enlist (or ,theme 'user))) - (fn (gensym (format "doom--customize-%s-h-" (mapconcat #'symbol-name themes "-"))))) + `(let ((fn (gensym "doom--customize-themes-h-"))) (fset fn (lambda () - (dolist (theme themes) + (dolist (theme (doom-enlist (or ,theme 'user))) (when (or (eq theme 'user) (custom-theme-enabled-p theme)) (apply #'custom-theme-set-faces 'user