emacs颜色主题问题
我使用这个网站创建了自己的颜色主题。我使用以下代码将一个新的 .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
“感觉”颜色主题正在某处缓存设置,然后在启动时重新加载。我缺少什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的代码中,您调用了
'color-theme-initialize
,它在包 颜色主题.el。然后你的代码就可以工作了。
In your code, you have a call to
'color-theme-initialize
, which doesn't exist as a function in the package color-theme.el.And then your code works.