When you set: (global-visual-line-mode 1) (global-linum-mode 1) you sometimes get weird behavior. If the [visual] line at the top of your window is not completely visible (i.e. some parts of it lie above your screen), you can sometimes trigger horizontal movement in that top line by performing random commands: moving, inserting text. Most consistently (though not always), I've been able to do cause this behavior by scrolling down when my cursor is at the end of a file. I am pretty sure this happens when linum "updates" the line number of the topmost line. The problem only occurs during a linum-update, and after my workaround, that top line number is no longer visible. Workaround (I'm not really sure it fixes the underlying problem): Change the first line in function "linum-update-window" (I believe: linum.el, line 134) from: (goto-char (window-start win)) to: (goto-char (1- (window-start win))) or, with indexing check: (goto-char (let ((first-char (window-start win))) (if (> first-char (point-min)) (1- first-char) first-char))) Partial Rationale: I knew that lines after the starting point didn't have this problem, so I was trying to make it start at the previous line. It turns out that starting at the previous character fixes it. I don't really know why.