* xterm-256color and face colors
@ 2009-12-12 23:24 Giorgos Keramidas
2009-12-13 2:51 ` Dan Nicolaescu
0 siblings, 1 reply; 4+ messages in thread
From: Giorgos Keramidas @ 2009-12-12 23:24 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 2432 bytes --]
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
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
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?
[-- Attachment #1.2: Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: \"emacs -nw\" with TERM='xterm' and 8 color cells --]
[-- Type: image/png, Size: 6611 bytes --]
[-- Attachment #3: \"emacs -nw\" with TERM='xterm-256color' and 256 color cells --]
[-- Type: image/png, Size: 6250 bytes --]
[-- Attachment #4: font-lock-string-face customize buffer in \"emacs -nw\" with TERM='xterm-256color' and 256 color cells --]
[-- Type: image/png, Size: 13618 bytes --]
[-- Attachment #5: list-colors-display in \"emacs -nw\" with TERM='xterm-256color' and 256 color cells --]
[-- Type: image/png, Size: 17307 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xterm-256color and face colors
2009-12-12 23:24 xterm-256color and face colors Giorgos Keramidas
@ 2009-12-13 2:51 ` Dan Nicolaescu
2009-12-13 3:18 ` Giorgos Keramidas
0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2009-12-13 2:51 UTC (permalink / raw)
To: Giorgos Keramidas; +Cc: emacs-devel
Giorgos Keramidas <keramida@ceid.upatras.gr> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xterm-256color and face colors
2009-12-13 2:51 ` Dan Nicolaescu
@ 2009-12-13 3:18 ` Giorgos Keramidas
2009-12-13 4:02 ` Giorgos Keramidas
0 siblings, 1 reply; 4+ messages in thread
From: Giorgos Keramidas @ 2009-12-13 3:18 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
On Sat, 12 Dec 2009 18:51:33 -0800 (PST), Dan Nicolaescu <dann@ics.uci.edu> wrote:
>Giorgos Keramidas <keramida@ceid.upatras.gr> writes:
>> 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.
>> ...
>> 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.
Hi Dan,
Thanks! Running the vttests/256colors.pl script from the source of
xterm itself shows that indeed this is an xterm problem with my local
xterm package. I'll rebuild my xterm with the WITH_256_COLOR=1 option,
check again and report back :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xterm-256color and face colors
2009-12-13 3:18 ` Giorgos Keramidas
@ 2009-12-13 4:02 ` Giorgos Keramidas
0 siblings, 0 replies; 4+ messages in thread
From: Giorgos Keramidas @ 2009-12-13 4:02 UTC (permalink / raw)
To: Dan Nicolaescu; +Cc: emacs-devel
On Sun, 13 Dec 2009 05:18:22 +0200, Giorgos Keramidas <keramida@ceid.upatras.gr> wrote:
> On Sat, 12 Dec 2009 18:51:33 -0800 (PST), Dan Nicolaescu <dann@ics.uci.edu> wrote:
>>Giorgos Keramidas <keramida@ceid.upatras.gr> writes:
>>> 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.
>>> ...
>>> 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.
>
> Hi Dan,
>
> Thanks! Running the vttests/256colors.pl script from the source of
> xterm itself shows that indeed this is an xterm problem with my local
> xterm package. I'll rebuild my xterm with the WITH_256_COLOR=1 option,
> check again and report back :)
Ok, that was the cause of the face problems. Rebuilding xterm with the
256-color option fixed everything. Thanks again.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-12-13 4:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-12 23:24 xterm-256color and face colors Giorgos Keramidas
2009-12-13 2:51 ` Dan Nicolaescu
2009-12-13 3:18 ` Giorgos Keramidas
2009-12-13 4:02 ` Giorgos Keramidas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).