custom--should-apply-setting
設定を反映すべきかどうか判定する。
table: 真偽表
custom--inhibit-theme-enable theme result
nil * true
apply-only-user user true
* * false
code: custom.el
(defun custom--should-apply-setting (theme)
(or (null custom--inhibit-theme-enable)
(and (eq custom--inhibit-theme-enable 'apply-only-user)
(eq theme 'user))))
code: example.el
(setq custom--inhibit-theme-enable 'apply-only-user)
(custom--should-apply-setting 'user)
;; => t
(setq custom--inhibit-theme-enable nil)
(custom--should-apply-setting 'changed)
;; => nil
(setq custom--inhibit-theme-enable t)
(custom--should-apply-setting 'changed)
;; => nil
(custom--should-apply-setting 'user)
;; => nil