Skip to content
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

Chunks not following automatic Emacs switch to light/dark theme #325

Open
basille opened this issue Jan 28, 2023 · 5 comments
Open

Chunks not following automatic Emacs switch to light/dark theme #325

basille opened this issue Jan 28, 2023 · 5 comments

Comments

@basille
Copy link

basille commented Jan 28, 2023

I've been using polymode for a long while now and I love it! The one thing that I've been bugging me however is that I set my Emacs to automatically switch between light and dark mode at sunrise/sunset (for instance using circadian, but I have the same issue with Auto-Dark for Emacs), and polymode's chunks get stuck in the mode they were loaded at startup (whether light or dark).

The result looks like this when switching to dark mode:

My guess is that this is directly related to the explanations given in issue #18: the theme of the chunks are only loaded at startup. The suggestion to M-x load-library polymode RET do not change the theme, and I'm not able to M-x load-file polymode.e — the only solution I have is to restart Emacs (which is annoying in the middle of an R session).

@basille
Copy link
Author

basille commented Apr 5, 2023

Up. Anything I could do to start debugging this?

@vspinu
Copy link
Collaborator

vspinu commented May 9, 2023

I think the face adjustment is not correctly computed then. The computation is done in poly-lock--adjusted-background

It relies on (frame-parameter nil 'background-mode). Could it be that the background-mode is not changed when the theme is changed? If so then it's not polymode's issue. Should be fixed upstream.

@basille
Copy link
Author

basille commented May 17, 2023

Thanks @vspinu for your feedback. Is there anything I could do to actually test your hypothesis? Happy to look further into it if I can help, although I really don't know how to get started.

@basille
Copy link
Author

basille commented Apr 22, 2024

Bringing this up — not sure where to start to try to debug this. Any suggestion @vspinu so I can get started?

@jloow
Copy link

jloow commented May 14, 2024

I'm also running into this problem. For me, however, I can edit the chunk and the background will change to the correct color.

Does anyone know what causes the background to change in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants