Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set custom background for linum mode?

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 left margin(the whole margin still have the color of the default background). How to set it right?

like image 689
Kirill2011 Avatar asked Aug 08 '11 13:08

Kirill2011


1 Answers

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.)

like image 140
sanityinc Avatar answered Nov 08 '22 00:11

sanityinc