title: Emacs - No line numbering for empty lines
body: <p>I'm trying to setup line numbering in Emacs.<br>
  Linum works well, but when I open two buffers, numbering for empty lines disappears.
  I use Manjaro Linux. Emacs works in the terminal.</p>
  
  <p><a href="http://i.stack.imgur.com/s3yy1.png" rel="nofollow">Here's screenshot.</a></p>
  
  <p>Code from .emacs file:</p>
  
  <pre><code>(add-hook 'find-file-hook (lambda () (linum-mode 1)))
  
  (unless window-system
    (add-hook 'linum-before-numbering-hook
      (lambda ()
        (setq-local linum-format-fmt
            (let ((w (length (number-to-string
                  (count-lines (point-min) (point-max))))))
              (concat "%"(number-to-string w) "d"))))))
  
  (defun linum-format-func (line)
    (concat
     (propertize (format linum-format-fmt line) 'face 'linum)
     (propertize " " 'face 'mode-line)))
  
  (unless window-system
    (setq linum-format 'linum-format-func))
  </code></pre>
  
  <p>How can I fix it?</p>