0

我使用这个网站创建了自己的颜色主题。我使用以下代码向我的 ./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)))

问题是我注意到,当我更改 your-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

它“感觉”就像颜色主题将设置缓存在某处,然后在启动时重新加载。我错过了什么?

4

1 回答 1

2

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

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

然后你的代码就可以工作了。

于 2010-07-29T15:21:39.183 回答