View Full Version : Emacs: set-background-color for ALL frames
Markhor
May 29th, 2009, 09:26 AM
Hello. I have (set-background-color #123456) set in my .emacs file.
Unfortunately, when I C-x 5 2 to open a new frame,
the new frame still has the default white background color.
I have searched for this answer extensively, but have not found the solution. Does anyone know how to set the background color for ALL frames? Thanks.
johnl
May 29th, 2009, 01:36 PM
I have the following in my .emacs which I believe solves this issue -- set your colors appropriately.
(setq default-frame-alist
(append default-frame-alist
'((foreground-color . "Black")
(background-color . "White")
(cursor-color . "SkyBlue")
)))
Hope this fixes the issue.
bajhn
April 8th, 2011, 10:00 AM
JohnL, thanks! You helped me figure out how to solve my problem. Here are my embellishments. I put this in my .emacs file so that I can change the color of the current frame and all future frames in my session at the push of a button. The color may not be the best, but my color vision is not normal.
(defun set-my-frame-options ()
"Set frame color so I can distinguish between two sessions."
(interactive)
(setq my-bgcolor "LightCyan2")
(setq default-frame-alist
; For a reason I do not understand, Lisp fusses about the parameter
; type in background-color below if I substitute (unquoted) my-bgcolor.
(append default-frame-alist
'((background-color . "LightCyan2")
)
)
)
(set-background-color my-bgcolor)
)
(global-set-key [f10] 'set-my-frame-options)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.