It has no business there. This is something I used to do long ago and
I tried to keep it for the upgrade to version 5.0.0. I believe we are
safe without it, but I guess we will find out.
Thanks to Stefan Monnier for pointing this out on the emacs-devel
mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00996.html>.
It is what I was trying to do before with 'color-distance', per the
comment right above:
;; NOTE 2025-11-25: I used to rely on `color-distance', thinking that
;; it would do the right thing here:
;;
;; (> (color-distance color "#ff0000") (color-distance color "#0000ff"))
;;
;; But my understanding of "warm" versus "cold" is simple, so better
;; do it my way.
But I did not originally see the simpler modus-themes-color-warm-p, so here we are!
We do not need to actually disable other Modus themes because their
palettes have the same entries, so the active theme will anyway take
effect over the others. And if another Modus theme has more colours in
its palette, then the user probably wants to keep those around.
We can always refine the implementation details, but at least the
results are looking very promising. I think/hope users will benefit
from this enhancement.
I think this is done now. All that remains is to (i) polish the
derived colors because some of them are not nice and (ii) check the
code again to make sure I am not being sloppy.
I wrote those changes earlier, but then forgot to commit. Then I came
back and accidentally reverted/destroyed what I had... This is going
off of memory, but I will need to check again.
We have to make sure that the value passed to :color is not
'unspecified'. Users may want to do this, given the option they have
via the overrides, and it is a fine use of the system. Internally
though, we have to adjust the :box to do the right thing instead of
throwing an error.
Thanks to JD Smith for reporting a bug along those lines in issue 9 of
my standard-themes repo (they are derived from the modus-themes, hence
the changes here): <https://github.com/protesilaos/standard-themes/issues/9>.
I am generalising the fix for all faces that could exhibit the same
problem. I will check if we need to do the same for some of the underlines.
This is because both can appear in the same context, whereas I thought
this would never happen.
Thanks to Rudolf Adamkovič for discussing this with me in the context
of the same change for my doric-themes (issue 20):
<https://github.com/protesilaos/doric-themes/issues/20>.