Question

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

Was it helpful?

Solution

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

(require 'zenburn)
(zenburn)

Loads fine via emacsclient.

OTHER TIPS

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.

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).

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...

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top