我不是 100% 确定这会解决您的问题,但您确实应该使用颜色主题来突出显示语法。Custom 是为刚开始使用 emacs 的用户设计的,所以我建议你试试 color-theme 看看它是否有效。这是我在我的机器上设置它的方法:
- 从颜色主题主页下载包。
- 将颜色主题文件夹放在
~/.emacs.d/color-theme/
.
- 确保此文件夹在您的加载路径中。我从 Steve Yegge 的帖子中获取了以下代码:
在您的 .emacs 中:
(defvar emacs-root "~/.emacs.d/")
(labels
((add-path
(p)
(add-to-list
'load-path
(concat emacs-root p))))
(add-path "lisp")
(add-path "color-theme-6.6.0")
(add-path "cedet-1.0"))
(require 'color-theme)
然后你定义你的颜色主题:
;; Color-theme
(eval-after-load "color-theme"
'(progn
(color-theme-initialize)
;; Set custom color theme
(defun color-theme-mine ()
"My custom color theme"
(interactive)
(set-cursor-color "#ffffff")
(color-theme-install
'(color-theme-mine
;; Super-light grey on Dark grey
((foreground-color . "#e0e0e0")
(background-color . "#151515")
(background-mode . dark))
(font-lock-comment-face ((t (:foreground "#106010")))) ;; Forest Green
;; More definitions below
;; ...
(color-theme-mine)) ;; end eval-after-load
这将color-them-mine
在您启动 emacs 时加载。您可以通过键入来查看所有可用的颜色主题M-x color-theme <TAB>
。要查看可用面的完整列表,请使用命令M-x list-faces-display
。