unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: help-gnu-emacs@gnu.org, emacs-devel@gnu.org
Subject: Re: Changing foreground/background colors in all frames
Date: Wed, 21 Jun 2006 20:38:38 +0300	[thread overview]
Message-ID: <200606211738.k5LHccts015909@beta.mvs.co.il> (raw)
In-Reply-To: <C0BEDF1F.7A1%swidanf@hhmi.org> (Swidan)

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

  parent reply	other threads:[~2006-06-21 17:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 15:33 Changing foreground/background colors in all frames Swidan, Firas
2006-06-21 17:24 ` Gilbert Harman
2006-06-21 18:45   ` Swidan, Firas
2006-06-21 17:38 ` Ehud Karni [this message]
2006-06-21 19:21 ` Peter Dyballa
     [not found] ` <mailman.3128.1150911529.9609.help-gnu-emacs@gnu.org>
2006-06-21 19:21   ` Norbert Melzer
2006-06-21 20:15     ` Drew Adams
     [not found] <mailman.3123.1150909180.9609.help-gnu-emacs@gnu.org>
2006-06-21 22:36 ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200606211738.k5LHccts015909@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=emacs-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).