I want to turn on linum mode (M-x linum-mode) automatically with python and c mode. I add the following code in .emacs, but it doesn't seem to work.
(defun my-c-mode-common-hook ()
(line-number-mode 1))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(defun my-python-mode-common-hook ()
(line-number-mode 1))
(add-hook 'python-mode-common-hook 'my-python-mode-common-hook)
What might be wrong?