[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs -nw conflicts with (set-foreground-color "xxx")

From: Eli Zaretskii
Subject: Re: emacs -nw conflicts with (set-foreground-color "xxx")
Date: Tue, 09 Oct 2007 23:46:50 +0200

> From: address@hidden
> Date: Tue, 09 Oct 2007 04:27:53 -0000
> Thanks for the tip.  I tried list-colors-display in "emacs -nw" and
> got the following 8 colors:
> black, red, green, yellow, blue, magenta, cyan, white
> This is odd, since I know the konsole can display far more colors than
> that.

Emacs cannot know how many colors can you console display.  It knows
only what the termcap/terminfo entry for that console tells it.  In
your case, it tells Emacs that 8 colors are supported.

> For example, if I put in my .emacs file
>     (set-background-color "yellow")
>     (set-foreground-color "black")
> then when I run "emacs -nw" the background is a dark brown-orange, and
> the foreground text is black.  xmag shows the background to be
> #b26818.
> This can make it difficult to read the text.
> If I use
>     (set-background-color "green")
>     (set-foreground-color "red")
> then the colors I actually end up with, according to xmag, are
> background #18b218 and foreground #b21818.
> Does this make any sense?  How can I get rid of the color
> modification?

It sounds like you are running in an xterm or some similar X-based
terminal emulator.  If so, the way to control the colors is to set up
the emulator to produce the color you want for every one of the 8
colors used by Emacs.  That is, set the terminal emulator to produce a
yellow color when you specify "yellow" in Emacs.  There should be some
configuration file or resources that can be used for that, but the
details depend on the emulator you use.

Emacs cannot help this in any way, because all it does is ask the
terminal emulator to display yellow color (actually, color number 3 or
something, i.e. it specifies the color by its ordinal number).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]