How set colors for a specific mode?

给你一囗甜甜゛ 提交于 2019-12-02 06:42:27

问题


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.


回答1:


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)


来源:https://stackoverflow.com/questions/27973721/how-set-colors-for-a-specific-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!