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've set up emacs to display line numbers (global-linum-mode 1), and it works until I start enlarging the text via text-scale-adjust

The line numbers column starts to shrink, and disappears entirely after a few increments.
When it has fully disappeared, further increments have no more effect on the left edge.

Is this a know issue? Is there a workaround?

Using GNU Emacs 23.1.1 in Ubuntu 10.04 (and I'm an emacs newb).

share|improve this question
When I do this in Emacs 23.1, the numbers on the left scale with the rest of the text and eventually get too big for the space they are in (making it hard to see them) but the column they are in remains the same size. Is this the same behavior you are seeing or are you seeing something else? – Steven D Feb 16 '11 at 20:10
Like Steven, what I observe is that the line numbers column stays the same width in pixels (so it becomes too small to fit the characters if you call text-scale-adjust with a positive argument). This looks like a bug in the implementation of the left-margin text property. I haven't investigated further. – Gilles Feb 16 '11 at 22:18
Thanks Steven and Gilles... It seems to be the same behaviour.. My line-number col does not narrow (as I first thought. It just looked that way as the text got larger (black ln-nb-col, and charcoal "wrap-indicator" margin). The line-numbers do a tectonic disappearing act "under" the nargin and buffer proper.. (a bug it seems) – Peter.O Feb 17 '11 at 16:06
I was able to fix it with this solution to a related problem: unix.stackexchange.com/a/237023/139097 – Pablo Machón Oct 18 '15 at 18:58
up vote 3 down vote accepted

Here is a workaround. It works on my emacs 23.1.1. This same question came up again (months later), and I'd learnt a bit about elisp in the mean time, so I had a go at it. See the following link for my answer there. Font size issues with Emacs in linum-mode.

share|improve this answer
Could you check-mark your answer, or are you waiting for other answers? – Stéphane Gimenez Feb 13 '12 at 18:37
I'd be quite happy with another answer. The method works, but is really a workaround which has a couple of issues I'd rather it didn't have: like hard coding font size steps (it should tap into something more direclt, but I don't know what that is... and the bottom section doesn't refresh properly when jumping from large font size back to normal. Pressing any key causes a refresh, but there must be a better way (and again, I don't know how).. And it really doesn't address the original issue; that of the line-number column not changing its width in sync with the zoom scale. – Peter.O Feb 14 '12 at 4:20

The easiest, most straightforward solution I've seen just to set the line numbers to a fixed height. This can be accomplished easily, in accordance with user78810's answer: Font size issues with Emacs in linum-mode

To wit, add the following line in your emacs config (or to your dotspacemacs/user-config function, if you're spacing out evil style):

(eval-after-load "linum"
  '(set-face-attribute 'linum nil :height 100))
share|improve this answer

Your Answer


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

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