`consult-theme` does not reload `doom-themes--color` when setting already-loaded theme

Issue

The doom-color function retrieves wrong colors when reverting color theme to previously-loaded doom-theme with consult-theme

Steps to reproduce

  1. Load a theme doom-theme-1 with any method
  2. Load another (unloaded) theme doom-theme-2 with consult-theme
  3. Select doom-theme-1 again with consult-theme
  4. The value of doom-themes--colors will reflect the palette of doom-theme-2 instead of the active doom-theme-1, making doom-color return wrong results.

Hacky fix

This problem does not occur using the :ivy and :helm completion modules, so I believe it to be an upstream problem with consult. I’ve localized the issue to the following expression in consult-theme:

...
(if (custom-theme-p theme)
          (enable-theme theme)
        (load-theme theme :no-confirm)))))
;; end of defun

It seems that the issue can be fixed by replacing this with

...
(when theme
      (load-theme theme :no-confirm))

via an :override advice where the rest of the consult-theme function is the same.