我在带有终端的 MacOS 10.6 上使用 emacs。我有一个白色背景。
很难阅读引用的 C++ 字符串。它们呈淡绿色。关键词是绿松石色的。
在搜索源代码后,我找到了 cpp.el,并确定我使用的是 cpp-face-light-name-list 而不是 cpp-face-dark-name-list。
显然这个函数应该根据背景颜色选择正确的列表:
(defcustom cpp-face-default-list nil
"Alist of faces you can choose from for cpp conditionals.
Each element has the form (STRING . FACE), where STRING
serves as a name (for `cpp-highlight-buffer' only)
and FACE is either a face (a symbol)
or a cons cell (background-color . COLOR)."
:type '(repeat (cons string (choice face (cons (const background-color) string))))
:group 'cpp)
但是好像不行。
我应该在我的 .emacs 文件中放入什么,以便获得 cpp-face-dark-list 而不是 cpp-face-light-list?
谢谢!
最佳答案
我有同样的问题,我选择的主题在终端上总是不可读。答案是使用 color-theme 包,正如其他人所说,然后在终端中为 Emacs 选择一个主题,并在其自己的窗口中为 Emacs 运行另一个主题,就像这样:
(require 'color-theme)
(setq color-theme-is-global t)
(if window-system
(color-theme-deep-blue) ;; Emacs in own window
(color-theme-dark-laptop) ;; Emacs in tty
)
在 Emacs 中,您可以键入 M-x color-theme-Tab
以获得可用主题的列表。同样,您可以为主要模式添加 Hook ,以根据您正在编辑的代码类型更改颜色主题。
关于macos - 使终端中的 emacs 使用深色而不是浅色字体锁定颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2617970/