From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "John Rabkin" Newsgroups: gmane.emacs.help Subject: Re: How does Emacs know the background color? Date: Mon, 17 Feb 2003 00:16:38 +0200 Organization: Verio Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: main.gmane.org 1045433910 20944 80.91.224.249 (16 Feb 2003 22:18:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Feb 2003 22:18:30 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18kX7E-0005RT-00 for ; Sun, 16 Feb 2003 23:18:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18kX9A-0006bN-08 for gnu-help-gnu-emacs@m.gmane.org; Sun, 16 Feb 2003 17:20:28 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!iad-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!not-for-mail User-Agent: Pan/0.13.0 (The whole remains beautiful) Original-Newsgroups: gnu.emacs.help X-NNTP-Posting-Host: line134-129.adsl.actcom.co.il Original-Lines: 39 Original-NNTP-Posting-Host: 192.114.47.10 Original-X-Complaints-To: abuse@verio.net Original-X-Trace: iad-read.news.verio.net 1045433646 192.114.47.10 (Sun, 16 Feb 2003 22:14:06 GMT) Original-NNTP-Posting-Date: Sun, 16 Feb 2003 22:14:06 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:110252 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6754 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6754 On Sun, 16 Feb 2003 08:10:38 +0000, Michael Herman wrote: > I am using a special mode for handling e-mail called post.el. In post.el > there are different faces depending on the background being 'light' or > 'dark'. When I launch emacs -nw from within an xterm with a white > background, emacs uses the face for a dark background. > > How does emacs determine what the background is? > > When I use -rv for the xterm, emacs still thinks the background is dark. > > On a sort of related note, is there a way to tell how emacs was launched > from the command line? I'd like to modify my .emacs to change settings > depending on whether I used emacs -nw or not. > > Thanks. I'm a newbie myself. The first thing I ever wrote (2 weeks ago) in elisp was: (defun reversed_colors () "Sets the background to black and the foreground to white" (set-background-color "black") (set-foreground-color "white") ) (if (equal window-system 'x) (reversed_colors) ) It's in my ~/.emacs file and works fine. > How does emacs determine what the background is? Try evaluating (set-background-color "black") -- "Cut your own wood and it will warm you twice" Regards, Yoni Rabkin