2010-07-29 53 views
0

我使用website创建了自己的颜色主题。我添加了一个新的.el文件到我的./site-lisp/color-theme/themes目录下面的代码:emacs color-theme问题

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

而这在我的.emacs文件:

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

问题是,我注意到,当我改变你的-配置名称 - here.el和退出Emacs设置,并重新加载它,所做的更改不会生效,直到我这样做:

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

它'感觉'像color-theme在某处设置缓存而不是在启动时重新加载。我错过了什么?

回答

2

在你的代码中,你有一个'color-theme-initialize的调用,它不在包color-theme.el中作为一个函数存在。

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

然后你的代码工作。

+0

非常感谢特雷,作品魅力。 – sonelliot 2010-08-03 11:20:27