开发者

How to set custom background for linum mode?

开发者 https://www.devze.com 2023-03-26 10:55 出处:网络
I\'m trying to get the same left margin as textmate mac-classic theme, i\'ve setup my custom face for fringe, but got some problems with left margin in linum-mode. If i try M-x customize-face linum ba

I'm trying to get the same left margin as textmate mac-classic theme, i've setup my custom face for fringe, but got some problems with left margin in linum-mode. If i try M-x customize-face linum background it sets my color only for linum-numbers, but not the whole l开发者_Python百科eft margin(the whole margin still have the color of the default background). How to set it right?


So you're setting the "fringe" and "linum" faces the same way, but "fringe" doesn't work when you apply your theme? The theme you're using, if it's this one, sets the fringe face background explicitly, so your customized definition is probably getting overridden by the theme's definition.

The solution is to modify the theme accordingly, or to put something like this in your .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"))

and use my-color-theme-mac-classic instead of color-theme-mac-classic.

(NB. You could use set-face-background instead, but set-face-attribute is more versatile.)

0

精彩评论

暂无评论...
验证码 换一张
取 消