all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How does Emacs know the background color?
@ 2003-02-16 14:10 Michael Herman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Herman @ 2003-02-16 14:10 UTC (permalink / raw)


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.

-- 
Michael Herman

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How does Emacs know the background color?
       [not found] <mailman.2005.1045404699.21513.help-gnu-emacs@gnu.org>
@ 2003-02-16 22:16 ` John Rabkin
  2003-02-17 18:05 ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: John Rabkin @ 2003-02-16 22:16 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How does Emacs know the background color?
       [not found] <mailman.2005.1045404699.21513.help-gnu-emacs@gnu.org>
  2003-02-16 22:16 ` How does Emacs know the background color? John Rabkin
@ 2003-02-17 18:05 ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2003-02-17 18:05 UTC (permalink / raw)


Michael Herman wrote:

> 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.

Check the window-system variable.  But it would be better to check the specific

display characteristics you're interested in instead.

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: How does Emacs know the background color?
@ 2003-02-18  6:41 Zaretskii Eli
  0 siblings, 0 replies; 4+ messages in thread
From: Zaretskii Eli @ 2003-02-18  6:41 UTC (permalink / raw)



This message was scanned for viruses and other malicious code by PrivaWall.


This mail was sent from ELTA SYS LTD.


> From: Michael Herman [mailto:michael-lists@thehermans.org] 
> Sent: Sunday, February 16, 2003 4:11 PM
> 
> 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?

It looks for an environment variable defined by xterm.  See startup.el
for more details.


This message is processed by the PrivaWall Email Security Server. 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-02-18  6:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2005.1045404699.21513.help-gnu-emacs@gnu.org>
2003-02-16 22:16 ` How does Emacs know the background color? John Rabkin
2003-02-17 18:05 ` Kevin Rodgers
2003-02-18  6:41 Zaretskii Eli
  -- strict thread matches above, loose matches on Subject: below --
2003-02-16 14:10 Michael Herman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.