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

Theme not fully loaded on switch #9

Open
basille opened this issue Dec 1, 2017 · 17 comments
Open

Theme not fully loaded on switch #9

basille opened this issue Dec 1, 2017 · 17 comments
Assignees
Labels
bug cant reproduce The issue cannot be reproduced or is outdated

Comments

@basille
Copy link

basille commented Dec 1, 2017

Thanks for this great package! And for the theme suggestions, I love them!

I'm using a very similar setup as the one from the README:

  (setq calendar-latitude 26.084534)
  (setq calendar-longitude -80.238454)
  (setq circadian-themes '((:sunrise . apropospriate-light)
                           (:sunset  . nord)))
  (circadian-setup)

The switch as sunrise/sunset does occur, but leaves me with a theme not fully loaded. Here is a screenshot of a session using Polymode on a RMarkdown file (so essentially mixing Markdown and ESS mode), after a sunset switch to Nord theme:

screenshot from 2017-12-01 17-29-06

Simply closing and restarting Emacs shows what I should have:

screenshot from 2017-12-01 17-33-33

What's missing is the correct background in the ESS chunk. Not too sure where to starts from here…

@guidoschmidt
Copy link
Owner

Hey basille,

glad you like the package 👍
And thanks a lot for reporting that bug - I had issues like this before, too. I thought the last update would have fixed it.

Which Emacs version and which package-version of circadian are you using, so I can try to work out what's going on.

@guidoschmidt guidoschmidt self-assigned this Dec 6, 2017
@basille
Copy link
Author

basille commented Dec 6, 2017

Sorry I should have started with this:

  • GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian
  • circadian 0.3.0 from MELPA-stable
  • ESS 17.11 from MELPA-stable (if that matters)

@basille
Copy link
Author

basille commented Dec 10, 2017

I also have problems in the morning when switching back to `apropospriate-light, now in the mode line. Here is what I have after automatic switching:

screenshot from 2017-12-08 08-51-46

Here is how it should be:

screenshot from 2017-12-08 08-54-05

Notice the vertical black bars which are not part of the theme.

@guidoschmidt
Copy link
Owner

Thanks for the information - I will try to check on the issue as soon as possible 🙂

@guidoschmidt
Copy link
Owner

@basille How do you install the themes, that you want to be loaded by circadian? I could reproduce the behaviour, you are experiencing only when installing themes with use-package. If you install them via use-package, too, try to add the :defer keyword - that solved the issue for me.

;; Try to add `:defer` keyword, if you're using use-package
(use-package apropospriate-theme :ensure :defer)
(use-package nord-theme :ensure :defer)

(use-package circadian
  :ensure
  :init
  :config
  (setq calendar-latitude 26.084534)
  (setq calendar-longitude -80.238454)
  (setq circadian-themes '((:sunrise . apropospriate-light)
                                           (:sunset  . nord)))
  (circadian-setup))

Let me know, if that solved your issue, too - otherwise I'll need to have a deeper look on what is going on in detail 🕵️

@basille
Copy link
Author

basille commented Dec 20, 2017

Thanks @guidoschmidt to look into it. As a matter of fact, I do not use use-package, but a custom init.org file that installs additional packages with package-install <whatever_package>. I'm not too familiar with use-package though — what does :defer do? Should I load the themes with something special? My setup regarding themes is really this only snippet from my initial post.

@guidoschmidt
Copy link
Owner

@basille Do you still have this issue? I just recently found out, that Emacs is loading a theme by default, when you do (require 'nord-theme) e.g (Didn't run into that issue, as I was using use-package from the very beginning - :defer just auto-loads the package lazily when it's need). Maybe you have some lines that require a theme in your init.org after (circadian-setup) has been called? 🤔

Additionally, did you check your timezone configuration, maybe circadian has issues fetching the correct sunrise/sunset time?

@basille
Copy link
Author

basille commented Jul 2, 2018

@guidoschmidt , thanks for your follow-up! As a matter of fact, I still have the same problem, and I regularly close and reopen Emacs when theme switches… You can find my complete .emacs here, but essentially, theme configuration is pretty much the first thing that happens… and coordinates are configured through calendar-latitude and calendar-longitude as shown in my initial post.

@guidoschmidt
Copy link
Owner

guidoschmidt commented Jul 9, 2018

@basille I just recently found some time to check your config - sorry for the long time period 😦

I cloned your .emacs.d and tried the recent version of circadian (0.3.2 - published yesterday) which worked fine so far. It turned out, that the nord-theme seems to be setting a bunch of custom-face-attributes, that are not part of default themeing. You could try to reset the custom-face-attributes using a hook:

(setq circadian-themes '((:sunrise . apropospriate-light) 
                         (:sunset . nord)))

;; This resets the custom-face-attributes list and will hopefully clear all customizations
;; that the nord-theme has set.
(add-hook 'circadian-before-load-theme-hook
          #'(lambda (theme)
              (setq custom-face-attributes '())))

(circadian-setup)

Could you try if that resolves your issue? 🤔
Another solution would be to rely on another theme instead of nord

@basille
Copy link
Author

basille commented Jul 11, 2018

@guidoschmidt, I have modified my setup in the meanwhile: the mode-line was actually using powerline, which I removed entirely due to various issues (mostly readability, but also this issue), and I need to do more testing about it. Unfortunately, themes only switch twice a day, and I don't necessarily have Emacs open at this moment! I'll definitely report back (and try the trick you just posted if need be). Thanks!

@basille
Copy link
Author

basille commented Jul 16, 2018

Hi @guidoschmidt, I tried the additional setup you suggested, but I still have the original issue (at the beginning of this thread), i.e. R chunks in Polymode not switching to the new mode together with the rest of the interface.

@guidoschmidt
Copy link
Owner

@basille did this issue resolve somehow? Looks like in your .emacs.d repository, you are using circadian? Is it working as expected, because still I can't really reproduce how that behaviour 🙈

@guidoschmidt guidoschmidt added the cant reproduce The issue cannot be reproduced or is outdated label Dec 23, 2022
@basille
Copy link
Author

basille commented Jan 10, 2023

Thanks @guidoschmidt for checking in, and sorry for the late answer! Unfortunately, I still have the same issues when switching to Nord theme — it may just have to do with this theme, to be honest I did not try other themes, and kind of got used to closing and restarting Emacs altogether… 🤦‍♂️

Would you like me to check with another night theme? (any suggestion for a good one?)

@guidoschmidt
Copy link
Owner

guidoschmidt commented Jan 20, 2023

All fine - I haven't worked on circadian for quite a while myself. I'm using doom-themes a lot, you could try with doom-nord e.g. hopefully it's really a specific issue with the theme and this helps

@basille
Copy link
Author

basille commented Jan 24, 2023

Thanks for the suggestion. Nice themes!
So I quickly played around using both doom-one and doom-one-light and unfortunately, same thing always happens: Whenever there's a switch, embedded R code blocks keep the previous one until they're edited.
It seems to me that there's a conflict between the way circadian switches themes, and how polymode deals with embedded chunks. Do you think it might be worth asking there too?

@basille
Copy link
Author

basille commented Jan 28, 2023

I just played around with another extension (Auto-Dark for Emacs), which shows the exact same problem on switching. Seems to reinforce the idea that the bug might actually be on the polymode side. Let me try there.

Repository owner deleted a comment from liuzhebaba Feb 23, 2024
@guidoschmidt
Copy link
Owner

@basille sorry this is not working for you for such a long time now. You could try a fresh Emacs config with almost nothing but your desired themes and circadian.el installed, to see if the issue still remains?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cant reproduce The issue cannot be reproduced or is outdated
Projects
None yet
Development

No branches or pull requests

2 participants