fix(lib): avoid writing customized faces to custom.el (take 4)

This time, the faces weren't being applied if THEME == 'user (for
`custom-set-faces!`).

Amend: afb9773d7c
Ref: #7929
Ref: #7933
This commit is contained in:
Henrik Lissner 2024-07-11 03:10:29 -04:00
parent c8b5bf7bd1
commit a6ba70aed7
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -6,11 +6,11 @@
;;;###autoload ;;;###autoload
(defun doom--run-customize-theme-hook (fn) (defun doom--run-customize-theme-hook (fn)
"Run FN, but suppress any writes to `custom-file'." "Run FN, but suppress any writes to `custom-file'."
(letf! ((#'custom--should-apply-setting #'ignore) (letf! (defun put (symbol prop value)
(defun custom-push-theme (prop symbol theme mode &optional value) (unless (string-prefix-p "saved-" (symbol-name prop))
(funcall custom-push-theme prop symbol theme mode value) (funcall put symbol prop value)))
(if (facep symbol) (face-spec-set symbol value t)))) (let (custom--inhibit-theme-enable)
(funcall fn))) (funcall fn))))
(add-hook! 'doom-load-theme-hook (add-hook! 'doom-load-theme-hook
(defun doom-apply-customized-faces-h () (defun doom-apply-customized-faces-h ()