mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
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.
This commit is contained in:
@ -16,11 +16,10 @@
|
|||||||
THEME can be a single symbol or list thereof. If nil, apply these settings to
|
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."
|
all themes. It will apply to all themes once they are loaded."
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
`(let* ((themes (doom-enlist (or ,theme 'user)))
|
`(let ((fn (gensym "doom--customize-themes-h-")))
|
||||||
(fn (gensym (format "doom--customize-%s-h-" (mapconcat #'symbol-name themes "-")))))
|
|
||||||
(fset
|
(fset
|
||||||
fn (lambda ()
|
fn (lambda ()
|
||||||
(dolist (theme themes)
|
(dolist (theme (doom-enlist (or ,theme 'user)))
|
||||||
(when (or (eq theme 'user)
|
(when (or (eq theme 'user)
|
||||||
(custom-theme-enabled-p theme))
|
(custom-theme-enabled-p theme))
|
||||||
(apply #'custom-theme-set-faces 'user
|
(apply #'custom-theme-set-faces 'user
|
||||||
|
Reference in New Issue
Block a user