lepisma / rogue

Personal Emacs config
339 stars 19 forks source link

emacsclient -cn incorrect colors #4

Closed nanjigen closed 1 year ago

nanjigen commented 5 years ago

Hi lepisma, this config is really cool! It took me ages to realize I had to pare down to (mostly) just the config.el (I believe there is some org beatifying in 'local/r-org' though.)

Any way I'm having an issue with running emacs --daemon=instance1 and then emacsclient -cn -s instance1, which is super useful for i3wm and quickly opening frames, but turns all the background colors to a horrible blue!

I've tested without your config.el and everything works. Eventually I looked at list-faces-display and saw that the faces generating the harsh blue colors were coming from the following in your config.el:

;; Variables (;; Palette from desktop color scheme (dark-1 "#2E3440") (dark-2 "#3B4252") (dark-3 "#434C5E") (dark-4 "#4C566A") (light-1 "#D8DEE9") (light-2 "#E5E9F0") (light-3 "#ECEFF4") (accent-dark "#1C2028") (accent-dark-gray (color-darken-name accent-dark 1)) (accent-light "#8a9899") (accent-shade-1 "#8FBCBB") (accent-shade-2 "#88C0D0") (accent-shade-3 "#81A1C1") (accent-shade-4 "#5E81AC") (colors-blue accent-shade-4) (colors-red "#BF616A") (colors-orange "#D08770") (colors-yellow "#EBCB8B") (colors-green "#A3BE8C") (colors-purple "#B48EAD")

Any ideas you have on how to fix this would be great! I have done quite a bit of testing with hooks and trying to run stuff on frames but nothing seems to stick.

lepisma commented 5 years ago

I think the problem is with the color-darken/lighten-name function. It generates a 12 char hex color (e.g. (color-darken-name "#1C2028" 1) -> "#19e41d9724fd") which doesn't get applied properly and only the first 6 chars are picked. I have faced this issue with the above example color (the first six make an ugly green at few places) and have been ignoring since it was a minor thing.

I guess that blue should also be fixed by fixing the lightening/darkening function. Will try out some time and let you know here.

nanjigen commented 5 years ago

Thanks for that, it looks great otherwise and the layer as a whole got me to switch over to spacemacs from vim!

If I turn up anything myself I'll add to this as well.

lepisma commented 5 years ago

I kind of fixed the issues I was facing with https://github.com/lepisma/rogue/commit/dabca7973ff827ba2066c42db5ab647e1fe4d73d

Let me know if yours still stays.

nanjigen commented 5 years ago

Thanks lepisma

I'm actually still getting this issue though after trying the new config.el -> I can't help but wonder if this is an problem related to emacsclient loading themes late (or too early) as has been mentioned elsewhere. It might be best to close this as its likely not an issue with your theme.

2018-12-14-090336_864x1380_scrot

This is what I see for reference. Oddly, I can get around it by specifying another theme in my .spacemacs (been using doom-dracula), while leaving doom-molokai in the config.el, possibly because the changes target that theme. Of course it means that I see doom-dracula colours, not your custom molokai.

lepisma commented 5 years ago

Right, I can reproduce the issue. Getting #0000FF for a few colors (default background, org-link foreground and a few others). Not sure if this is because of:

  1. the way I am setting the colors
  2. the colors that I am setting, or
  3. some other thing which is handled when we create new themes the proper way

In any case, let's keep the issue open. It is definitely something that can be fixed in the config.

romanakmath commented 5 years ago

Hey lepisma,

I also really enjoy your configuration, but also struggle with getting the client work properly on windows. If I open runemacs and keep it a single instance everything seems fine, but as soon as I try to open files with emacsclientw there seem to be some color mistakes and my defined heights for org levels in your config.el file don't seem to work anymore (Though the spacemacs loads blazingly fast with the clientw). Any ideas what could be the reason for it and how to change this behavior? Here is how it should look like and looks with runemacs right2

and here is how it looks when I start the org file with emacsclientw:

wrong2

lepisma commented 5 years ago

Sorry, I don't know what might be causing this offhand. Looks like emacsclient has problems with other theme related stuff too.

I can try to debug it but can't assure a date. At some point in time I might just extract these themes out, that will help in debugging this on vanilla Emacs.

lepisma commented 5 years ago

Actually @Rareform , can you try something similar to this solution? It looks reasonable and we might be missing the face settings because of no frame being present in daemon mode. Can you also, just for sanity check, see if this is okay?

  1. Start emacs normally (no daemon)
  2. Run (start-server)
  3. Do emacsclient -c -n
romanakmath commented 5 years ago

Strangely it seems to be a system dependent issue. With my other windows pc I don't encounter this problem, and running alt x start server and emacsclient -c -n works. I will report how it turned out on a laptop, where I have this issue. I have another little question, how can I show double dot as a normal double dot and not as the rectangles which are the default in the configuration? test

lepisma commented 5 years ago

This looks like a font issue. The font you are using (which doesn't look like 'Iosevka', as your config says) doesn't have the glyph for that character (?).

Can you try changing the font or installing Iosevka?

romanakmath commented 5 years ago

Installing Iosevka solves the problem with the missing symbols, thanks a lot, I spend yesterday a lot of time on this! By the way, there is some bug with switching the themes via SPC T n, it brings the error Symbol’s function definition is void: r-org/reset-buffers, but this can be circumvented via SPC T s. Is there any possibility to change the default theme? I tried r-current theme, and switching the order in dotspacemacs-themes, but every time doom molokai is the standard when starting spacemacs.

lepisma commented 5 years ago

Yes, I can reproduce the default theme issue (even after setting '(spacemacs-light doom-molokai) and r-light-theme as the current-theme) and have to toggle again manually to get the default light theme. But not sure about the reset-buffers error since that means your system is not loading the r-org package. If you are not loading that explicitly, you should remove (r-org/reset-buffers) calls from r-light and r-dark functions (I have stuff setup in a very works-on-my-machine way and so haven't really put much effort in modularizing).