emacs 24 ansi-term seems to ignore theme colors
Asked Answered
S

2

6

I have upgraded to Emacs 24 from Emacs 23 on OSX using brew. Right now, I'm updating my .emacs to use the new stuff from emacs 24 esp. the new package manager and the built-in color themes. I installed the zenburn theme from marmalade (I think), deleted the old color-theme extension from my extensions directory, and removed my configuration which adds the old color-theme extension to the load path.

One thing I have noticed is that ansi-term colors does not follow the color theme. In emacs 23, my ansi-term looked like this: emacs23 ansi-term colors

But now it looks like this: enter image description here

I have checked ansi-color-names-vector and ansi-color-map. Both of them reports colors from zenburn. Switching themes still do not change the ansi-term colors, so I think this is not a theme specific problem.

Any ideas how I can fix this problem?

Sherri answered 3/8, 2012 at 15:55 Comment(4)
I do not understand your problem. I use color-theme with emacs24...Modernistic
Is that the color-theme bundled with emacs24, or an external one? I used to use an external color-theme extension. But since emacs24 has a bundled color-theme, I deleted the external one and used the bundled one instead. Every theme works fine except for ansi-term. It seems to ignore the theme colors.Sherri
external -- download.savannah.gnu.org/releases/color-theme Xavier Maillard (release manager) + Brian PalmerModernistic
I wish to update my .emacs as well, from color-theme to internal color theme. If you managed to make the conversion, can you tell me how you did in the meantime ?Modernistic
U
7

The variable ansi-term-color-vector was not set in the new version of the zenburn-theme. I submitted a pull request to fix it.

In the mean time just use the following line:

(setq ansi-term-color-vector [unspecified "#3f3f3f" "#cc9393" "#7f9f7f" "#f0dfaf" "#8cd0d3" "#dc8cc3" "#93e0e3" "#dcdccc"])
Unscrupulous answered 3/8, 2012 at 21:22 Comment(5)
Nice! I also submitted an issue regarding this problem. I will tag your pull request in it. Thanks!Sherri
I'm the zenburn maintainter and the variable is set here ;;; custom theme variables (custom-theme-set-variables 'zenburn `(ansi-color-names-vector [,zenburn-bg ,zenburn-red ,zenburn-green ,zenburn-yellow ,zenburn-blue ,zenburn-magenta ,zenburn-cyan ,zenburn-fg]) No idea why this gets ignored by ansi-term...Tropous
It is not the same variable. They have very similar name which is confusing.Unscrupulous
Thanks, where can I find a description of what each of the colors in the ansi-term-color-vector is for? Also, is there a color in this list for the background color of the buffer, and for the background color of the text in an ansi-term buffer?Cortese
This is just a list of colors, what each color does it determined by the shell. It is in order: background (of the text) black red green yellow blue magenta cyan and white. The background of the buffer is set with your theme.Unscrupulous
M
1

The external color-theme requires no configuration to work well. Just save your color theme using color-theme-print, and insert its output FUNCTION in .emacs, and this one:

(and
 (eq window-system 'x)
 (color-theme-FUNCTION) )
Modernistic answered 3/8, 2012 at 16:31 Comment(1)
This is what I'm using before emacs24. But right now, I'm trying out the built in theming in emacs24 using this theme github.com/bbatsov/zenburn-emacs. Maybe I'll use the old color-theme for the mean time, since I'm always using ansi-term.Sherri

© 2022 - 2024 — McMap. All rights reserved.