~protesilaos/modus-themes

1

Variables `modus-themes-preset-overrides-{faint,intense}` not defined until after theme is loaded

Koen van Greevenbroek <koenvg@posteo.net>
Details
Message ID
<31038fd76868fa3d07c9a429dfed8fd6ac374bb8.camel@posteo.net>
DKIM signature
missing
Download raw message
Hi, and thanks for the excellent package.

I noticed that, when using the built-in version of the modus themes (as
of latest commit on emacs master branch, 4e4a808eca) the variables
`modus-themes-preset-overrides-{faint,intense}` are not defined until
after a modus theme has been loaded. This means that, when starting
emacs with `emacs -Q`, the following code doesn't work:

(setq modus-themes-common-palette-overrides modus-themes-preset-
overrides-intense)
(load-theme 'modus-operandi)

(Fails with "Lisp error: (void-variable modus-themes-preset-overrides-
intense)")
However, the following does work:

(load-theme 'modus-operandi)
(setq modus-themes-common-palette-overrides modus-themes-preset-
overrides-intense)
(load-theme 'modus-operandi)

This doesn't quite seem like the ideal way of setting things up. Am I
missing something or should the `modus-themes-preset-overrides-
{faint,intense}` variables be automatically loaded somehow?

Kind regards,

Koen
Details
Message ID
<87bknh19g4.fsf@protesilaos.com>
In-Reply-To
<31038fd76868fa3d07c9a429dfed8fd6ac374bb8.camel@posteo.net> (view parent)
DKIM signature
missing
Download raw message
> From: Koen van Greevenbroek <koenvg@posteo.net>
> Date: Mon,  2 Jan 2023 10:24:48 +0000
>
> Hi, and thanks for the excellent package.

Hello Koen and you are welcome!

> [... 19 lines elided]

> This doesn't quite seem like the ideal way of setting things up. Am I
> missing something or should the `modus-themes-preset-overrides-
> {faint,intense}` variables be automatically loaded somehow?

Does this work on your end?

    (require-theme 'modus-themes)

    (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-intense)

    (load-theme 'modus-operandi)

I tried it on 'emacs -Q' with a current build.

Notice the 'require-theme' function.  This is used instead of 'require'
because the built-in themes are not "libraries": they are not in the
'load-path' (this is not my decision).

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)