如何设置特定模式的颜色? [英] How set colors for a specific mode?

查看:186
本文介绍了如何设置特定模式的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试Emacs。我想为Eshell设置颜色。我先用set-foreground-color尝试了。但是它也影响了我的其他模式。

 (add-hook'eshell-mode-hook(lambda :前台#BD8700)))))))

但是这也不工作。或者它也影响其他模式/ scratch 上的颜色。有人有建议吗?



这不是一个重复的问题,因为其他答案也改变其他缓冲区的颜色。

解决方案

这是一个链接有关重新映射面的文档: http://www.gnu .org / software / emacs / manual / html_node / elisp / Face-Remapping.html

 (defun my- eshell-mode-faces()
(face-remap-add-relative'default'((:foreground#BD8700))))

(add-hook'eshell-mode -hook'my-eshell-mode-faces)


I'm trying Emacs. I would like to set colors for Eshell. I tried that first with set-foreground-color. But it affects my other modes too.

  (add-hook 'eshell-mode-hook (lambda ( default ((t (:foreground "#BD8700"))))))

But that's not working either. Or it's affecting the colors on other modes/scratch too.

Have anyone a suggestion? This is not a duplicate question, because the other answers change the colors of other buffers as well.

解决方案

Here is a link to the documentation regarding remapping faces: http://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html

(defun my-eshell-mode-faces ()
  (face-remap-add-relative 'default '((:foreground "#BD8700"))))

(add-hook 'eshell-mode-hook 'my-eshell-mode-faces)

这篇关于如何设置特定模式的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆