升级到 Snow Leopard 后,Emacs 背景变灰

升级到 Snow Leopard 后,Emacs 背景变灰

我在 MacBook 的 Terminal 中使用 Emacs。我已将 Emacs 配置为使用 color-theme 包。我更喜欢“whateveryouwant”主题,它有白色背景。顺便说一句,我的 Terminal 会话中也有白色背景。

现在,升级到 Snow Leopard 后,我的 Emacs 背景变成灰色。这很烦人。

我正在运行 GNU Emacs 22.3.1。

我怎样才能使我的 Emacs 背景变成白色?

更多信息

如果我使用 'emacs -q' 启动​​ emacs,则 emacs 背景为白色。当我有一个仅包含以下内容的 .emacs 时:

(add-to-list 'load-path "~/.emacs.d/color-theme/")
(require 'color-theme)
(color-theme-initialize)
(color-theme-whateveryouwant)

背景变为灰色。

我尝试通过输入“make”重新编译最新版本的颜色主题,但收到以下错误消息:

http://pastebin.com/f71b6bec4

知道为什么吗?似乎是因为安装 Snow Leopard 时安装了新的 emacs,而它不喜欢颜色主题?

更多信息

我还没有修复灰色背景。我确实通过以下更改修复了编译错误:

diff --git a/color-theme/themes/color-theme-example.el b/color-theme/themes/color-theme-example.el
index f73b4f6..1961a01 100644
--- a/color-theme/themes/color-theme-example.el
+++ b/color-theme/themes/color-theme-example.el
@@ -1,4 +1,5 @@
 (eval-when-compile
+  (add-to-list 'load-path "~/.emacs.d/color-theme/")
   (require 'color-theme))

 (defun color-theme-example ()
diff --git a/color-theme/themes/color-theme-library.el b/color-theme/themes/color-theme-library.el
index d194708..edc7d94 100644
--- a/color-theme/themes/color-theme-library.el
+++ b/color-theme/themes/color-theme-library.el
@@ -28,6 +28,7 @@

 ;; Code:
 (eval-when-compile
+  (add-to-list 'load-path "~/.emacs.d/color-theme/")
   (require 'color-theme))

 (defun color-theme-gnome ()

不幸的是,每当初始化颜色主题时,我仍然会看到灰色背景而不是白色。

答案1

将默认面的背景值从“白色”调整为“gray00”可解决问题。

您可以调整 color-theme-library.el,但我更建议调整您的 .emacs。

(add-to-list 'load-path "~/.emacs.d/color-theme/")
(require 'color-theme)
(color-theme-initialize)
(color-theme-whateveryouwant)
;
; Force background color to white for Snow Leopard
; TODO: revisit this fix when the reason why the background
; was gray is identified.
;
(custom-set-faces
 '(default ((t (:stipple nil :background "gray00" :foreground "black"
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil
:slant normal :weight normal :height 1 :width normal :family "default")))))

您可以使用以下方法获得类似的结果Mx 自定义 > 脸部 > 基本脸部 > 默认脸部并将背景设置为“gray00”。

答案2

将其添加到你的 .emacs:

(add-to-list 'default-frame-alist '(background-color . "white"))

答案3

Emacs 正在寻找

themes/color-theme-example.elc

但你的主题示例写为

/Users/gharfst/.emacs.d/color-theme/color-theme.elc

在你的 init.el 中尝试这个:

(setq color-theme-directory "/Users/gharfst/.emacs.d/color-theme")

答案4

找不到支持我理论的文档,但我认为 Emacs 只是添加了阴影以突出终端中的白色背景。反之亦然。我想您可以尝试将终端背景更改为灰色来看看?

相关内容