3

I use Emacs within Terminal on my MacBook. I have configured Emacs to use the color-theme package. I prefer the "whateveryouwant" theme, which has a white background. Incidentally, I also have a white background in my Terminal sessions.

Now, after upgrading to Snow Leopard, my Emacs background is grey. This is annoying.

I'm running GNU Emacs 22.3.1.

How can I make my Emacs background white?

More info

The emacs background is white if I start with emacs with 'emacs -q'. When I have an .emacs that only contains this:

(add-to-list 'load-path "~/.emacs.d/color-theme/")
(require 'color-theme)
(color-theme-initialize)
(color-theme-whateveryouwant)

the background becomes grey.

I tried recompiling the latest version of color-theme by typing 'make', and I get this error message:

http://pastebin.com/f71b6bec4

Any idea why? Seems to be that installing Snow Leopard installed a new emacs, which doesn't like color theme?

Even more info

I still have not fixed the grey background. I did fix the compile errors with these changes:

diff --git a/color-theme/themes/color-theme-example.el b/color-theme/themes/color-theme-example.el
index f73b4f6..1961a01 100644
--- a/color-theme/themes/color-theme-example.el
+++ b/color-theme/themes/color-theme-example.el
@@ -1,4 +1,5 @@
 (eval-when-compile
+  (add-to-list 'load-path "~/.emacs.d/color-theme/")
   (require 'color-theme))

 (defun color-theme-example ()
diff --git a/color-theme/themes/color-theme-library.el b/color-theme/themes/color-theme-library.el
index d194708..edc7d94 100644
--- a/color-theme/themes/color-theme-library.el
+++ b/color-theme/themes/color-theme-library.el
@@ -28,6 +28,7 @@

 ;; Code:
 (eval-when-compile
+  (add-to-list 'load-path "~/.emacs.d/color-theme/")
   (require 'color-theme))

 (defun color-theme-gnome ()

Unfortunately, I still get a grey background instead of white whenever color-theme is initialized.

1
  • what do you get as result when running M-: (frame-parameter nil 'background-mode)? It should be "light" and not "dark" if your background is white.
    – mihi
    Sep 18, 2009 at 17:14

5 Answers 5

4
+100

Adjusting the background value of the default face from "white" to "gray00" fix the issue.

You could adjust the color-theme-library.el, but I prefer to suggest to adjust your .emacs.

(add-to-list 'load-path "~/.emacs.d/color-theme/")
(require 'color-theme)
(color-theme-initialize)
(color-theme-whateveryouwant)
;
; Force background color to white for Snow Leopard
; TODO: revisit this fix when the reason why the background
; was gray is identified.
;
(custom-set-faces
 '(default ((t (:stipple nil :background "gray00" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil
:slant normal :weight normal :height 1 :width normal :family "default")))))

You could achieve a simular result by using M-x customize > Faces > Basic Faces > Default Face and setting Background to "gray00".

2
  • Wow, thanks! I hope the color-theme library is adjusted once the reason is identified, but for now this is excellent. I finally have my white background back!
    – user10934
    Sep 20, 2009 at 22:37
  • I'm not sure that the color-theme library need to be adjusted. I really try to identify the reason of that strange behaviour. We could assume that gray00 == white... so I suppose there is something else that interferes with the color-theme... Anyway, the goal was to make it work asap. Sep 20, 2009 at 23:43
2

Add this to your .emacs:

(add-to-list 'default-frame-alist '(background-color . "white"))
4
  • This didn't help.
    – user10934
    Sep 14, 2009 at 11:42
  • Curious. Have you tried emacs -q to see if the problem is in your .emacs? Sep 14, 2009 at 15:33
  • ah yes, i'll edit my question.
    – user10934
    Sep 14, 2009 at 18:25
  • Note: for me, (add-to-list 'default-frame-alist '(background-color . "gray00")) finally solved the problem. None of the above worked except for going to customize > Faces ... every single darn time Jan 16, 2012 at 8:25
1

Emacs is looking for

themes/color-theme-example.elc

but your theme example was written as

/Users/gharfst/.emacs.d/color-theme/color-theme.elc

Try this in your init.el:

(setq color-theme-directory "/Users/gharfst/.emacs.d/color-theme")
1
  • This didn't solve my grey background, but it helped me solve the compile errors. I'll edit my question with the new info.
    – user10934
    Sep 15, 2009 at 17:52
0

Hit M-x customize then go to "faces" and then "basic faces". There you can alter the default face. The foreground and background settings are the ones you want to look at.

1
  • 1
    I browsed through customize, as you suggested. I see that the background is white. I see "[X] Background: white (sample)". Unfortunately, on the screen, the background is grey.
    – user10934
    Sep 12, 2009 at 17:25
0

Can't find documentation to support my theory, but I think Emacs is just adding the shading to stand out from the white background in Terminal. Or vice versa. I suppose you could try changing your Terminal background to Grey to see?

1
  • Nope -- I changed the background to black, and the emacs background is still grey.
    – user10934
    Sep 14, 2009 at 11:40

You must log in to answer this question.