How to fix the "Character function definition is invalid" when loading a color theme in emacs24?

When I load my .emacs , although the color theme, twilight, loads normally, but it shows me this error message:

 Symbol function definition is void: color-theme-twilight 

In my .emacs I added the following lines to add a color theme:

 (require 'color-theme) (setq color-theme-is-global t) (color-theme-initialize) (color-theme-twilight) 

The color-theme-twilight.el file is located in ~/.emacs.d/themes/

I reviewed this question. But the solution is a typo correction. But I do not make this typo. I'm on emacs24. What is the problem?

+7
emacs color-scheme
source share
3 answers

Solved a problem. All lines removed:

 (require 'color-theme) (setq color-theme-is-global t) (color-theme-initialize) (color-theme-twilight) 

And just added:

 (load-file "~/.emacs.d/themes/color-theme-twilight.el") 

The problem was the last line:

 (color-theme-twilight) 

The other three lines are not required at all. Not sure if this is the most elegant solution.

+7
source share

If you are using emacs 24, I think you can change the 4 lines that you included in this single line:

 (load-theme 'twilight t) 

No additional requirements; it uses the emacs 24 thematic approach.

If you are using a recent version of twilight, this should not cause errors.

+1
source share

You say: "The color-theme-twilight.el file lives in ~ / .emacs.d / themes /." But I do not see where you are downloading this file. Add (require 'color-theme-twilight) to your initialization file and make sure that color-theme-twilight.el is in your load-path .

0
source share

All Articles