How set colors for a specific mode?

2019-02-28 06:12发布

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条回答
做个烂人
2楼-- · 2019-02-28 06:53

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)
查看更多
登录 后发表回答