Hooking the new line number mode in Emacs 26.1 doesn't work

938 Views Asked by At

In my init.el file, I am using a hook to display line numbers in all programming modes:

(add-hook 'prog-mode-hook 'linum-mode)

When I recently upgraded to Emacs version 26.1, I wanted to take advantage of the new display-line-number-mode, minor mode since it is supposed to be

much faster and doesn't usurp the display margin for the line numbers

according to the NEWS file. So I simply replaced linum-mode in init.el:

(add-hook 'prog-mode-hook 'display-line-number-mode)

however, it doesn't work, when Emacs loads I get the message:

Symbol’s function definition is void: display-line-number-mode

Hints on how to solve this will be greatly appreciated!

1

There are 1 best solutions below

0
Mark Skilbeck On BEST ANSWER

The correct function is display-line-numbers-mode, not display-line-number-mode. Simple spelling mistake.