1

When I boot I launch emacs --daemon and it evaluates my .emacs with one exception:

(add-to-list 'load-path "~/.elisp/zenburn-emacs") ;fix loading issue

(require 'zenburn)

;;; color theme - zenburn?

(add-to-list 'load-path "~/.elisp/color-theme")

(require 'color-theme)

(eval-after-load "color-theme" '(progn (color-theme-initialize)))

I know that the load-path stuff works because M-x zenburn loads the color scheme just fine once I launch emacsclient with emacsclient -nw.

Does anybody know what is up with (eval-after-load [snip - see above])?

Is this a bug?

System Info:

GNU Emacs 23.2.1

Installed in debian sid on2.6.32-5-amd64 Version: 23.2+1-7

Filename: pool/main/e/emacs23/emacs23_23.2+1-7_amd64.deb

5 Answers5

3

And a tip from the current maintainer of Zenburn for Emacs(yours truly):

(add-to-list 'load-path "~/.elisp/color-theme")
(add-to-list 'load-path "~/.elisp/zenburn-emacs")
(require 'zenburn)
(zenburn)

You don't need to require color-theme since zenburn requires it internally. You do need, however, to call the zenburn function after you've required zenburn.

You're actually invoking the (zenburn) function when you type M-x zenburn and this is why the theme is getting applied just then instead of on startup.

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
2

You don't really say what isn't working?

(require 'zenburn) isn't enough to start the theme.
You need to call (color-theme-zenburn) as well (or its alias (zenburn), as you are doing interactively).

phils
  • 71,335
  • 11
  • 153
  • 198
  • I think Phils is right: Instead of your (eval-after-load ...) line, you could just use (zenburn). I don't think color-theme-initialize actually changes the color theme, it just loads libraries. – Tyler Mar 24 '11 at 12:07
1

This is too long for a comment:

I have in my .emacs file the following line:

(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))

If I put for example

(color-theme-taylor)

after this line it works, if I put it before this line, it doesn't.

I.e.

(require 'color-theme)
(color-theme-initialize)    

(setq default-frame-alist '((font . "Inconsolata-20") (tool-bar-lines . 0) (menu-bar-lines . 0)))

(color-theme-taylor)

works... perhaps your problem may have a similar cause...

student
  • 1,636
  • 3
  • 29
  • 53
1

FWIW, here's how I load zenburn in my .emacs:

(require 'zenburn)
(zenburn)

Loads fine via emacsclient.

Josh
  • 444
  • 2
  • 7
  • zenburn is a shorter alias of the function color-theme-zenburn. The explicit require of color-theme and setq color-theme-is-global are redundant. – Bozhidar Batsov Mar 24 '11 at 16:24
0

Something like (progn (require 'color-theme) (color-theme-initialize)) should work. To see (eval-after-load "color-theme" '(progn (color-theme-initialize))) does what it should do, check if color-theme-initialize is appended to after-load-alist (describe-variable C-h v). If not, it could be a bug.

vpit3833
  • 7,817
  • 2
  • 25
  • 25