0

Is it possible to remove a sub-theme so that it does not appear in the theme list when invoking load-theme or customize-themes?

For instance removing only doom-spacegrey from the doom theme-set, while keeping the other sub-themes.

A related question is whether it is possible to install only a deliberate subset of sub-themes from a main theme.

0

doom-spacegrey is part of doom-themes package. It's not a "sub-theme" but file included in package.

You can remove doom-spacegrey-theme.el from ~/.emacs.d/elpa/doom-themes-<version>/. But it will appear again on doom-themes package update.

Better solution would be to add advice around custom-theme-name-valid-p function which is used by custom-available-themes to filter out valid theme names:

(defvar my/blacklisted-themes '("doom-spacegrey"))

(defun my/theme-allowed (orig-fun theme-name)
  (and (funcall orig-fun theme-name)
       (not (member (symbol-name theme-name) my/blacklisted-themes))))
(advice-add 'custom-theme-name-valid-p :around #'my/theme-allowed)

Although theme isn't actually removed it will not appear in the list of available themes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.