I have written till the 35th line in Emacs with activated line numbers (so my last line number is 35). When I am writing in the 32nd line there are line numbers flickering up to the 43rd line number (appearing only while writing) and when I stop they disappear.

The line numbers I mentioned (35 32 43) are just to explain the problem and they are simply my current line numbers. The same happens if I have 5 or 10 or any number of lines.

Why are those line numbers flickering and how can I make them stop appearing?

  • Can you reproduce the behaviour with a minimal Emacs session (aka emacs -q)?
    – wasamasa
    Commented Dec 6, 2014 at 19:45
  • @wasamasa How do I do that?
    – Adam
    Commented Dec 6, 2014 at 20:01
  • A few of the members of the Emacs development team recommend using nlinum-mode instead of linum-mode. elpa.gnu.org/packages/nlinum.html
    – lawlist
    Commented Dec 6, 2014 at 20:02
  • @Adam You open a terminal emulator, enter emacs -q and hit the enter key. Then you go ahead, enable linum-mode and write your text to see whether the problem still happens.
    – wasamasa
    Commented Dec 6, 2014 at 20:08
  • @wasamasa I did it and there is no problem.
    – Adam
    Commented Dec 6, 2014 at 20:14

1 Answer 1


Line numbers (of the kind that's displayed as a strip with every line number on a window's side) are known for their performance and redrawing issues. One of them is that they're using the display margin which interferes with other packages that (indirectly) manipulate the margins.

The more prominent examples would be auto-complete-mode and company-mode. auto-complete-mode inserts extra text into the buffer for its popup which can be seen by extra whitespace (without line numbers) at the end of the file when completing at a place with sufficient lines of text after it or by lots of non-existant lines (with line numbers) when completing at a place with not enough lines after it. company-mode on the other hand does not insert extra text, but does instead mask the margin so that whenever you complete at a place with sufficient lines of text after it, the line numbers covered by the popup are hidden. I suggest giving company-mode a try since its behaviour is a bit less jarring.

An alternative "solution" would be foregoing linum-mode entirely and instead display the current line number in the mode line with line-number-mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.