[Top][All Lists]

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

Re: Changing foreground/background colors in all frames

From: Ehud Karni
Subject: Re: Changing foreground/background colors in all frames
Date: Wed, 21 Jun 2006 20:38:38 +0300

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.


(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 <http://www.keyserver.net/>    Better Safe Than Sorry

reply via email to

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