繁体   English   中英

emacs颜色主题问题

[英]emacs color-theme problem

我使用此网站创建了自己的颜色主题。 我已使用以下代码将新的.el文件添加到./site-lisp/color-theme/themes目录中:

(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

感觉就像颜色主题将设置缓存在某个位置,然后在启动时不重新加载。 我想念什么?

在您的代码中,您有一个对'color-theme-initialize的调用,该调用在color-theme.el包中没有作为函数存在。

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

然后您的代码就可以了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM