-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M-x toggle-theme' née
theme-choose-variant' ignores modus hooks.
#112
Comments
From: "11F. Driver" ***@***.***>
Date: Sat, 13 Jul 2024 16:17:11 -0700
The built-in function `toggle-theme` does not run hooks in
`modus-themes-after-load-theme-hook`. It's probably not a big enough
issue to be put into the modus package, but it did cause me a touch of
confusion earlier today.
Maybe you can try the 'enable-theme-functions' hook instead? It will run
in that situation. Though it can cause issues if you are switching
between a Modus and non-Modus theme. I have not tested that scenario.
…--
Protesilaos Stavrou
https://protesilaos.com
|
Ah, an abnormal hook! ( (defun maybe-run-modus-theme-hooks (theme)
(when (memq theme '(modus-vivendi modus-operandi))
(run-hooks 'modus-themes-after-load-theme-hook)))
(add-hook 'enable-theme-functions #'maybe-run-modus-theme-hooks) |
From: "11F. Driver" ***@***.***>
Date: Wed, 17 Jul 2024 16:15:59 -0700
Ah, an abnormal hook! (`C-h v`'s words, not mine). It passes the
current theme, so I've modified my stuff. Seeing as this is just a
hook, would it make sense to add this into modus? It synchronises the
behaviour of modus' own toggling commands and the built-in commands.
```emacs-lisp
(defun maybe-run-modus-theme-hooks (theme)
(when (memq theme '(modus-vivendi modus-operandi))
(run-hooks 'modus-themes-after-load-theme-hook)))
(add-hook 'enable-theme-functions #'maybe-run-modus-theme-hooks)
```
This approach is good, though I am not sure we should have it in the
themes. At which point would it be activated? And, more importantly,
when do we remove this hook? There is 'disable-theme-functions', of
course, but how do we handle it?
…--
Protesilaos Stavrou
https://protesilaos.com
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The built-in function
toggle-theme
does not run hooks inmodus-themes-after-load-theme-hook
. It's probably not a big enough issue to be put into the modus package, but it did cause me a touch of confusion earlier today.Perhaps a quick note could be put in the documentation? I advised
theme-choose-variant
to get what I wanted:Cheers for all your work on the modus themes; I'm always deeply impressed when using them!
The text was updated successfully, but these errors were encountered: