Commentary: This extension of linum can smart control width of line number displayed, If line number can be viewed of current buffer is from 1 to 50, then width of line number is 2, and line number can be viewed of current buffer is from 100 to 150, then width of line number is 3. and use it, you can customize line number format with linum+-dynamic-format even if linum-format is 'dynamic. For more details, see article Use linum+ smart display line number
http://emacser.com/linum-plus.htm
Installation: Copy linum+.el to your load-path and add to your .emacs: (require 'linum+) then use M-x linum-mode to turn on line number displaying
Screenshots:

Download: LinumPlus
See also: LineNumbers
I’m using Lisp:linum+.el (and subsequently line-num.el) to provide line numbering. Line numbers are followed a by a pipe (”|”) and then a blank space. This is fine except the blank space is a different color from the buffer’s background. Is there a way I can make these two colors the same? – [[frznchckn?]]
Hi, frznchckn, thanks for using my linum+.
what’s your linum-format, and what’s your face linum?
If you just use linum+ use (require ‘linum+) and do not change any configuration, line numbers are followed by a pipe (”|”), but no blank space following pipe, that gap you saw is just fringe if you use emacs gui version, you can toggle it use M-x fringe-mode RET RET, and if you use emacs in console or term, you should can not see any blank spaces or gap following pipe (”|”).
If your linum-format end with blank spaces, its face (and spaces’ face) will be controlled by face linum, and you should set its background color same as your emacs background color if you want make these two colors the same. – ahei