Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to use the Emacs theme billw, except with a different background colour. I have the following in my .emacs file:

(require 'color-theme)
(color-theme-initialize)
(color-theme-billw)
(set-background-color "gray12")

However this doesn't seem to change the background colour on startup; I need to manually run set-background-color "gray12" in the minibuffer at the beginning of each session.

Any help with this? I tried creating my own custom theme based on the output of color-theme-print but this caused more problems than it's worth...

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The color-theme-billw function internally uses the color-theme-install-frame-params function to change frame parameters. So you can change frame parameters in the same way as follows:

(require 'color-theme)
(color-theme-initialize)
(color-theme-billw)
(color-theme-install-frame-params
  '((background-color . "gray12")))

C-hfcolor-theme-install-frame-params

(color-theme-install-frame-params PARAMS)

Change frame parameters using alist PARAMETERS.

If color-theme-is-global is non-nil, all frames are modified using modify-frame-parameters and the PARAMETERS are prepended to default-frame-alist. The value of initial-frame-alist is not modified. If color-theme-is-global is nil, only the selected frame is modified. If color-theme-is-cumulative is nil, the frame parameters are restored from color-theme-original-frame-alist.

If the current frame parameters have a parameter minibuffer with value only, then the frame parameters are not installed, since this indicates a dedicated minibuffer frame.

share|improve this answer
    
Perfect, thank you so much! –  John J. Camilleri Oct 1 '12 at 18:33

Position your cursor ("point" in GNU Emacs parlance) where you want to set the "background". Preferably where there is no text displayed. Then enter M-x describe-face.

Emacs will tell you witch face (all that GNU Emacs can display have a "face") you are looking at. Most probably "default". Then in the bottom of the window, click on "you can customize this face".

You are now "in customize". (it is just some sort of wizard to get/set values from/to your ~/.emacs) Set the background color you want, then click on "save for future sessions".

There you have it. Now look at the bottom of your ~/.emacs, inside (custom-set-faces ...), this is your face definition.

BTW, color-theme is now somehow built-in GNU Emacs 24. I have this in my .emacs:

(custom-set-variables

...stuff...

 '(custom-enabled-themes (quote (tango-dark)))

...stuff...)
share|improve this answer
    
In this case, it turns out you need to do the following: (custom-set-faces `(default ((t (:background "gray13"))))) –  John J. Camilleri Oct 8 at 13:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.