如何为linum模式设置自定义背景?

Kir*_*011 8 emacs textmate themes

我试图获得与textmate mac-classic主题相同的左边距,我已经为边缘设置我的自定义面,但是在linum模式下左边距有问题.如果我尝试Mx customize-face linum background它只为linum-number设置我的颜色,而不是整个左边距(整个边距仍然有默认背景的颜色).如何设置正确?

san*_*inc 10

所以你设置"边缘"和"linum"的面孔方式相同,但是当你应用主题时,"边缘"不起作用?您正在使用的主题(如果是这个)明确设置边缘面背景,因此您的自定义定义可能会被主题定义覆盖.

解决方案是相应地修改主题,或者在.emacs中添加这样的内容:

(require 'color-theme-mac-classic)
(defun my-color-theme-mac-classic ()
  (interactive)
  (color-theme-mac-classic)
  (set-face-attribute 'fringe nil :background "#CCC")
  (set-face-attribute 'linum nil :background "#CCC"))
Run Code Online (Sandbox Code Playgroud)

并使用my-color-theme-mac-classic而不是color-theme-mac-classic.

(注意:您可以使用set-face-background,但set-face-attribute功能更多.)