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?
Asked
Active
Viewed 5,611 times
8
-
I just tried it and it seems do do what you request. Setting the background color of the linum face gives everything left of the fringe that color. Perhaps you could give us some more information, or even a couple of screenshots? I've got emacs 23.3.1 for windows. You? – db48x Aug 08 '11 at 15:17
-
I've got emacs 23.2.1 from ubuntu repository and this is a screenshot of my problem [link](http://flic.kr/p/abc6B5) – Kirill2011 Aug 08 '11 at 16:15
1 Answers
11
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.)

sanityinc
- 15,002
- 2
- 49
- 43
-
Doesn't work. The same result [result](http://flic.kr/p/abfJ7J). The problem is that i don't understand how to set background for left margin(zone under linum numbers). – Kirill2011 Aug 08 '11 at 19:50
-
1It does work, but linum doesn't paint all the way down. The fringe on the other hand is continuous. Try setting the fringe background to your default background. But you can't make linum paint all the way down. Sadly. – Michael Markert Aug 08 '11 at 21:15
-
Thanks for clarifying that Michael - I should have mentioned that quirk in my answer! – sanityinc Aug 09 '11 at 07:16
-
1It's a pity. I think this is the first uncustomizable feature in emacs that i found... – Kirill2011 Aug 09 '11 at 12:34