I want to prompt for a theme only if modus-themes-to-toggle is not
right.
Thanks Morten Kjeldgaard for bringing this matter to my attention in
issue 44 in the ef-themes repository (those are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/44>.
This gives users and derivative themes the option to pick a suitable
value for those interfaces.
Thanks to aikrahguzar for making this suggestion in issue 70 of my
ef-themes repository (the ef-themes are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/70>.
This is because our check involves this:
(let ((theme-exists-p (get name 'theme-feature)) ...) ...)
Thanks to Daniel Colascione for informing me about this in issue 201:
<https://github.com/protesilaos/modus-themes/issues/201>.
I tried to do this with a recent commit but that broke things because
I also included a deftheme declaration. Having that meant that
modus-themes-theme would not declare the theme with all its data,
including its palette.
I looked at loaddefs-generate--emacs-batch and it seems that having
just the theme-autoload line is enough.
This reverts commit 122d53333f.
The reason is that this breaks the package when trying to load a theme
at startup. This was reported by Eamonn Sullivan in issue 69 in the
ef-themes repository: <https://github.com/protesilaos/ef-themes/issues/69>.
This is what allows the modus-themes to be loaded in the early-init.el
because they no longer depend on color-name-to-rgb to be available at
that time.
This change was done in pull request 199: <https://github.com/protesilaos/modus-themes/pull/199>.
It is within the ~15-line limit, meaning that Mike does not need to
assign copyright to the Free Software Foundation.
Replace `color-name-to-rgb' with a new internal helper
`modus-themes--hex-to-rgb' that uses `color-values-from-color-spec'
(a C built-in since Emacs 28.1) to parse hex RGB strings without
any display dependency.
This fixes a crash when loading a Modus theme during early-init.el
on GUI Emacs (e.g. macOS Homebrew emacs-plus), where
`color-name-to-rgb' fails because `color-values' returns nil before
the display is ready.
The fix applies to all three direct call sites:
- `modus-themes-wcag-formula' (the critical one, called during
theme loading)
- `modus-themes-generate-color-blend'
- `modus-themes-color-warm-p'
Fixes#198.
This relies on our own functions, which should be available even if
the theme is loaded via the early-init.el.
Thanks to Jacod "Jake" Gordon for reminding me to fix this and for
testing my prototype. It was done in issue 197:
<https://github.com/protesilaos/modus-themes/issues/197>.
This is because it is the only colour that is guaranteed to contrast
with the warning and error colours we use for long lines and non-empty
second line.
This is because typically themes have a 'provide-theme' in their file,
which we do not have in our theme files. Not doing a 'provide-theme'
at all times can break user configurations.
Thanks to Daniel Colascione for pointing this out in issue 195:
<https://github.com/protesilaos/modus-themes/issues/195>.
Previously, we'd sometimes specify a direction, but then we'd guess the
direction again `modus-themes-generate-gradient'. This commit removes
that guess and specifies the direction explicitly in all cases.
fixes https://github.com/protesilaos/ef-themes/issues/65