emacs颜色主题问题

发布于 2024-09-12 03:07:38 字数 1842 浏览 7 评论 0原文

我使用这个网站创建了自己的颜色主题。我使用以下代码将一个新的 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情何以堪。 2024-09-19 03:07:38

在您的代码中,您调用了 'color-theme-initialize,它在包 颜色主题.el

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

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

In your code, you have a call to 'color-theme-initialize, which doesn't exist as a function in the package color-theme.el.

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

And then your code works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文