views:

137

answers:

1

I created my own color theme using this website. I've added a new .el file to my ./site-lisp/color-theme/themes directory with the following code:

(defun your-config-name-here ()
  (interactive)
  (color-theme-install
   '(your-config-name-here
      ((background-color . "#ffffff")
      (background-mode . light)
      (border-color . "#000000")
      (cursor-color . "#333333")
      (foreground-color . "#000000")
      (mouse-color . "black"))
     (fringe ((t (:background "#000000"))))
     (mode-line ((t (:foreground "#000000" :background "#666666"))))
     (region ((t (:background "#999999"))))
     (font-lock-builtin-face ((t (:foreground "#000000"))))
     (font-lock-comment-face ((t (:foreground "#000000"))))
     (font-lock-function-name-face ((t (:foreground "#000000"))))
     (font-lock-keyword-face ((t (:foreground "#000000"))))
     (font-lock-string-face ((t (:foreground "#000000"))))
     (font-lock-type-face ((t (:foreground"#000000"))))
     (font-lock-variable-name-face ((t (:foreground "#000000"))))
     (minibuffer-prompt ((t (:foreground "#7299ff" :bold t))))
     (font-lock-warning-face ((t (:foreground "Red" :bold t))))
     )))
  (provide 'your-config-name-here)

And this in my .emacs file:

  (add-to-list 'load-path "~/../site-lisp/color-theme/")
  (add-to-list 'load-path "~/../site-lisp/color-theme/themes")

  (require 'color-theme)
  (require 'your-config-name-here)
  (eval-after-load "color-theme"
    '(progn
      (color-theme-initialize)
      (your-config-name-here)))

The problem is that I've noticed that when I change settings in your-config-name-here.el and exit emacs and reload it, that the changes don't take affect until I do this:

M-x load-file ~/../site-lisp/color-theme/themes/your-config-name-here.el
M-x your-config-name-here

It 'feels' like color-theme is caching the settings somewhere and not reloading then on start-up. What am I missing?

+2  A: 

In your code, you have a call to 'color-theme-initialize, which doesn't exist as a function in the package color-theme.el.

(eval-after-load "color-theme"
  '(progn
     ;; remove this call (color-theme-initialize)
     (your-config-name-here)))

And then your code works.

Trey Jackson
Many thanks Trey, works a charm.
sonelliot