Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I added the following lines to my .emacs.d/init.el to auto-activate linum at startup:

(require 'linum)
(global-linum-mode 1)
(setq linum-format “%d “)

But no way, i still have to manually M-x linum-mode to make it display line numbers in my C buffers (and all other buffers).
Any idea?

(GNU Emacs 23.2.1, modified by Debian)

share|improve this question
~/.emacs/init.el is not loaded automatically, do you mean ~/.emacs.d/init.el? According to gnu.org/software/emacs/manual/html_node/emacs/… it will also not automatically load ~/.emacs.d/init.el if you have a ~/.emacs file – Ulrich Dangel Jul 10 '12 at 16:58
Thanks Ulrich, I meant .emacs.d/init.el, and I have no directory of file .emacs... – Francois Jul 11 '12 at 7:28
Is this copied verbatim from your init.el? Your double quotes are wrong, use ", not . Then it works for me (at least from my ~/.emacs file). – daniel kullmann Jul 11 '12 at 8:23
actually it happens there were a syntax error higher in my init.el so the linum specific commands were skipped. Thanks for your help anyway! should i delete my question? – Francois Jul 12 '12 at 9:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.