在Emacs中的颜色主题之间切换(< v.24) [英] Switching between color themes in Emacs ( < v.24)
问题描述
更新:
请注意,此线程不适用于最新版本的Emacs(24+)。现在,Emacs自带了强大的彩色主题系统(例如,查看评论这里),不需要加载外部包 color-theme
。
我在我的 .emacs
文件中有以下代码片段,其中我定义了一些允许我在一对夫妇之间方便切换的别名的颜色主题使用短的扩展命令:
(需要'color-theme)
(eval-after-load color-theme
(progn
(color-theme-initialize)
(color-theme-aalto-light))
;;别名到颜色主题,例如'Mx a'切换到颜色主题 -
(defalias'a'color-theme-hober)
(defalias'b'color-theme-aalto-light)$ b $现在,当Emacs加载时,它显示 color-theme-aalto-light code>主题,而当我 Mx a
更改为 color-theme-hober
时,工作也。
问题是当我尝试将颜色主题再次更改为 color-theme-aalto-light
。一些颜色面孔仍然保留在旧色彩主题中,而其他颜色的面孔则更改为新的颜色主题。我尝试使用不同的颜色主题组合,没有运气(颜色面孔不不总是完全更新,无论我之间切换的颜色 - 主题)。任何想法?
解决方案这是color-theme包中已知的错误。如果该功能对您很重要,请考虑升级到中继(未来的emacs-24.1),它本机支持更改主题( Mx customize-themes
)。
Update:
Note that this thread does not applyt o recent versions of Emacs (24+). Emacs now comes with it's own powerful color theming system (e.g. see a review here) that does not required loading the external package color-theme
.
I have the following code snippet in my .emacs
file, where I defined a few aliases that allow me to switch conveniently between a couple of color themes using short extended commands:
(require 'color-theme)
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
(color-theme-aalto-light)))
;; Aliases to color-themes, e.g. 'M-x a' switches to color-theme-hober
(defalias 'a 'color-theme-hober)
(defalias 'b 'color-theme-aalto-light)
Now, when Emacs loads, it displays the color-theme-aalto-light
theme properly, and, when I M-x a
to change to color-theme-hober
, that works too.
The problem is when I try to change the color theme back again to color-theme-aalto-light
. Some color faces remain in the old color-theme while others are changed to the new color theme. I have tried with different color theme combinations with no luck (the color faces are not always fully updated, regardless of the color-themes I switch between). Any thoughts?
解决方案 This is a known bug in 'color-theme' package. If that feature is important for you, consider upgrading to trunk (future emacs-24.1), it natively supports changing themes (M-x customize-themes
).
这篇关于在Emacs中的颜色主题之间切换(< v.24)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!