[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xterm-256color and face colors
From: |
Dan Nicolaescu |
Subject: |
Re: xterm-256color and face colors |
Date: |
Sat, 12 Dec 2009 18:51:33 -0800 (PST) |
Giorgos Keramidas <address@hidden> writes:
> Hi all,
>
> The version of Emacs I am currently running is ``GNU Emacs 23.1.90.1
> (i386-unknown-freebsd9.0, GTK+ Version 2.18.4) of 2009-12-11 on kobe'',
> built from a Git snapshot a couple of days ago.
>
> A recent update to FreeBSD synchronized our termcap database entries for
> "xterm*" terminals with the one in xterm's source distribution. This
> was the first step towards making Emacs really support more than 8 color
> cells in xterm windows under FreeBSD.
>
> Unfortunately this seems to have broken many face-colors that use X11
> names in their face attributes. With the current termcap database of
> FreeBSD using a TERM value of "xterm" causes Emacs to fall back to 8
> color cells, but most of the faces map into these color cells correctly.
> The result is similar to the attached "emacs-23-xterm.png" screenshot,
> also available at:
>
> http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm.png
>
> Using a TERM value of "xterm-256color", on the other hand, causes Emacs
> to have 256 color cells, but font-locking fails to pick up the color
> definitions of many font faces, resulting in no color at all for those
> faces. For example the same `M-x ielm' session does not highlight
> strings with any color at all. The result is similar to the attached
> "emacs-23-xterm-256color.png" screenshot, also available at:
>
>
http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm-256color.png
Emacs considers xterm to have a light background by default, and it
chooses face colors based on that.
So first step in getting this solved you want to start
"xterm -bg white -fg black".
> Trying `M-x customize-face RET font-lock-string-face RET' shows that
> strings should be using "LightSalmon" as their color, but the sample
> text near the color definition uses no color at all. The screenshot
> attached as "emacs-23-xterm-256color-string-face.png" shows this, and is
> also available online at:
>
>
http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm-256color-string-face.png
This looks like a problem with xterm or the termcap/terminfo settings. Emacs
things that there are 256 colors, but when it tries to use them they
don't work correctly.
Check if xterm is compiled with 256 colors support, there's a script in
the xterm sources called 256colors2.pl, run it and see if you can get
many colors displayed.
Also try
$ tput setaf 21
it should change the foreground to blue #0000ff
$ tput setab 196
it should change the background to red #ff0000
> The list of face-colors from `M-x list-colors-display' shows 256 colors
> when TERM="xterm-256color" but the colors upwards of slot 16 are all
> unnamed, as in the attached "emacs-23-xterm-256color-list.png"
> screenshot, also available at:
>
>
http://people.freebsd.org/~keramida/emacs-xterm256/emacs-23-xterm-256color-list.png
>
> I see that `color-name-rgb-alist' is populated with a list of X11 color
> names, but these names are not used at all for face colors in xterm
> windows that have TERM="xterm-256color". Any ideas how I can make Emacs
> use the already loaded colors from `color-name-rgb-alist' to populate
> the 256 available color cells?
That's not done.
But faces can still use any color name in `color-name-rgb-alist', and
the color get mapped to one of the 256 colors available.