From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.help,gmane.emacs.devel Subject: Re: Changing foreground/background colors in all frames Date: Wed, 21 Jun 2006 20:38:38 +0300 Organization: Mivtach-Simon Insurance agencies Message-ID: <200606211738.k5LHccts015909@beta.mvs.co.il> References: Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8-i Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150911545 1994 80.91.229.2 (21 Jun 2006 17:39:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jun 2006 17:39:05 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, emacs-devel@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 21 19:39:02 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Ft6fM-0006as-OR for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Jun 2006 19:39:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ft6fM-0001Wl-7R for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Jun 2006 13:39:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ft6fA-0001WR-Ns for help-gnu-emacs@gnu.org; Wed, 21 Jun 2006 13:38:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ft6f7-0001WF-VD for help-gnu-emacs@gnu.org; Wed, 21 Jun 2006 13:38:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ft6f7-0001WC-SP; Wed, 21 Jun 2006 13:38:45 -0400 Original-Received: from [193.16.147.12] (helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Ft6pu-0002N6-Pg; Wed, 21 Jun 2006 13:49:55 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.13.6/8.13.6) with ESMTP id k5LHcdfH011692; Wed, 21 Jun 2006 20:38:39 +0300 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.13.6/8.13.6) with ESMTP id k5LHccq2015912; Wed, 21 Jun 2006 20:38:38 +0300 Original-Received: (from root@localhost) by beta.mvs.co.il (8.13.6/8.13.6/Submit) id k5LHccts015909; Wed, 21 Jun 2006 20:38:38 +0300 Original-To: swidanf@hhmi.org In-reply-to: (Swidan) X-Mailer: Emacs 21.3.1 rmail (send-msg 1.108) 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:35575 gmane.emacs.devel:56062 Archived-At: On Wed, 21 Jun 2006 11:33:51 -0400, Swidan, Firas wrote: > > I am unable to set the default foreground and background colors in all emacs > frames. I have added > > (set-background-color "black") > (set-foreground-color "white") > > To my .emacs. This changes the setting in the first emacs frame. However, > if I use > > C-x 5 f > > To open a new file in a new frame, the foreground/background settings in the > .emacs file do not seem to affect the look of the new frame. The docs for these functions state clearly they change colors only for the selected frame. Below is a little function that changes values on all frames (current and future ones), use it. Ehud. (defun set-frame-value-all (key val) ;; change frame attribute (aput 'initial-frame-alist key val) ;; for ALL frames (aput 'default-frame-alist key val) (modify-frame-parameters (selected-frame) (list (cons key val)))) ;; instead of (set-background-color "black") use: (set-frame-value-all 'background-color "black") ;; instead of (set-foreground-color "black") use: (set-frame-value-all 'foreground-color "black") -- Ehud Karni Tel: +972-3-7966-561 /"\ Mivtach - Simon Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign Insurance agencies (USA) voice mail and X Against HTML Mail http://www.mvs.co.il FAX: 1-815-5509341 / \ GnuPG: 98EA398D Better Safe Than Sorry