From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: emacs -nw conflicts with (set-foreground-color "xxx") Date: Tue, 09 Oct 2007 23:46:50 +0200 Message-ID: References: <1191867040.227702.174990@57g2000hsv.googlegroups.com> <1191904073.568407.236850@g4g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1191966447 16977 80.91.229.12 (9 Oct 2007 21:47:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Oct 2007 21:47:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 09 23:47:25 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IfMv7-0004Tk-8X for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Oct 2007 23:47:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfMv1-0007b4-CZ for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Oct 2007 17:47:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfMul-0007Za-9f for help-gnu-emacs@gnu.org; Tue, 09 Oct 2007 17:46:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfMui-0007ZF-U7 for help-gnu-emacs@gnu.org; Tue, 09 Oct 2007 17:46:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfMui-0007ZC-MG for help-gnu-emacs@gnu.org; Tue, 09 Oct 2007 17:46:52 -0400 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IfMui-0006bi-6n for help-gnu-emacs@gnu.org; Tue, 09 Oct 2007 17:46:52 -0400 Original-Received: from HOME-C4E4A596F7 ([81.5.45.170]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id JBN85665 (AUTH halo1); Tue, 9 Oct 2007 23:46:39 +0200 (IST) In-reply-to: <1191904073.568407.236850@g4g2000hsf.googlegroups.com> (sigma.sullivan@gmail.com) X-Detected-Kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:48275 Archived-At: > From: sigma.sullivan@gmail.com > 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).