Fix custom-set-*-faces! macros in Emacs 27

custom--inhibit-theme-enable is non-nil by default in Emacs 27, which
inhibits uses of `custom-theme-set-faces` when modifying any theme other
than 'user.
This commit is contained in:
Henrik Lissner 2019-11-22 16:16:27 -05:00
parent 4351474bf3
commit e7019e4163
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -19,12 +19,13 @@ all themes. It will apply to all themes once they are loaded."
`(let ((fn (gensym "doom--customize-themes-h-")))
(fset
fn (lambda ()
(dolist (theme (doom-enlist (or ,theme 'user)))
(when (or (eq theme 'user)
(custom-theme-enabled-p theme))
(apply #'custom-theme-set-faces theme
(mapcan #'doom--custom-theme-set-face
(list ,@specs)))))))
(let (custom--inhibit-theme-enable)
(dolist (theme (doom-enlist (or ,theme 'user)))
(when (or (eq theme 'user)
(custom-theme-enabled-p theme))
(apply #'custom-theme-set-faces theme
(mapcan #'doom--custom-theme-set-face
(list ,@specs))))))))
(when (or doom-init-theme-p (null doom-theme))
(funcall fn))
(add-hook 'doom-load-theme-hook fn 'append)))