我使用此website创建了自己的颜色主题。我已经使用以下代码在我的./site-lisp/color-theme/themes目录中添加了一个新的.el文件:
(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)))
问题是我注意到当我更改你的-config-name-here.el中的设置并退出emacs并重新加载它时,更改才会生效:
M-x load-file ~/../site-lisp/color-theme/themes/your-config-name-here.el
M-x your-config-name-here
感觉就像颜色主题在某处缓存设置而不是在启动时重新加载。我错过了什么?
答案 0 :(得分:2)
在您的代码中,您呼叫'color-theme-initialize
,该功能在包color-theme.el中不作为函数存在。
(eval-after-load "color-theme"
'(progn
;; remove this call (color-theme-initialize)
(your-config-name-here)))
然后你的代码就可以了。