Closed fredcy closed 8 years ago
I have exactly the same problem, just with Terminal.app instead of iTerm. In fact, I am using color-theme-solarized
from MELPA, which I believe is the same as this project. I have tried to require color-theme
before loading the theme, but that does not change anything. I have installed Emacs with Homebrew (emacs-mac
formula from the railwaycat/emacsmacport
tap).
It is worth mentioning that, despite those errors, the theme seems to look ok even in the terminal (but I have not tested it much).
Try setting solarized-termcolors
to 256 rather than (the default) 16. I should try to make this variable smarter – some 256-color terms actually do support the named colors in addition to the standard 256, others don’t. And the named colors are more correct if they’re available.
I added (customize-set-variable 'solarized-termcolors 256)
and now I no longer see any of the "Unable to load color" messages, so that does the trick. Thanks.
(I thought I had tried that before. Perhaps I was not setting solarized-termcolors
the right way or in the right place.)
Just for reference this error seems to be sent whether the terminal recognizes the color name or not.
The reason setting solarized-termcolors
to 256 solves the problem is because the color values used are hex color strings instead of color names.
As long as the target terminal recognizes a color name, it will be set correctly. (the Emacs error message will still show of course, but it's a false report.)
My emacs Messages\ buffer has many messages like this when loading the solarized theme.
These happen only when running in an iterm2 terminal, not when running Emacs.app. I installed emacs with homebrew on Mac OS X 10.10.5.
color-theme
anywhere.M-: (display-color-cells)
I get "256 (#o400, #x100, ?Ā)".Here is the init code I'm using: