I don't know how to display in the mode line a character count for the line I'm currently editing.

I tried searching on Google, but nothing came up, only for the whole document or for a selection. I wanted it to count on its own without need for a manual selection.

Does anyone know how to do it?

1 Answer 1


Here's one simple way:

(setq global-mode-string
      '(:eval (format "%d chars" (- (line-end-position) (line-beginning-position)))))

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.