From 6b7ab46e57127fdb7dc848d29199e6fc45a2f74b Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Sat, 9 Jan 2021 13:57:40 +0000 Subject: [PATCH] Remove use-package theme from global list of custom-enabled-themes * eval-when-compile for cases where use-package is only required at compile time * remove the 'use-package theme from custom-enabled-themes so e.g. (mapc #'disable-theme custom-enabled-themes) won't kill user settings. --- lisp/use-package/use-package-core.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index c44c36f77fd..9edcff0ea15 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -43,10 +43,15 @@ (require 'cl-lib) (require 'tabulated-list) -;; Declare a synthetic theme for :custom variables. -;; Necessary in order to avoid having those variables saved by custom.el. -(deftheme use-package) +(eval-and-compile + ;; Declare a synthetic theme for :custom variables. + ;; Necessary in order to avoid having those variables saved by custom.el. + (deftheme use-package)) + (enable-theme 'use-package) +;; Remove the synthetic use-package theme from the enabled themes, so +;; iterating over them to "disable all themes" won't disable it. +(setq custom-enabled-themes (remq 'use-package custom-enabled-themes)) (if (and (eq emacs-major-version 24) (eq emacs-minor-version 3)) (defsubst hash-table-keys (hash-table) -- 2.39.2