kotct / dot

A collaborative configuration for various tools.
MIT License
3 stars 2 forks source link

Transition from linum to built-in line numbers #98

Closed cg505 closed 6 years ago

cg505 commented 6 years ago

See the help for variable display-line-numbers in emacs 26.

At this point we should maintain compatibility with emacs 25, but if we can use the builtin line numbers, we should, since they are faster and better.

rye commented 6 years ago

I'm a huge fan of this new functionality, and I think we should definitely incorporate it on compatible clients. Perhaps just globally disable linum-mode and then globally enable disable-line-numbers-mode or patch how we do things to incorporate this on Emacs 26+.

FWIW, this fixes some broken-ish functionality with linum-mode. IIRC, we chose to use standard space characters over an alternative like U+00A0 (non-breaking space) because they display properly in non-unicode-supporting terminals e.g. Linux terminal. However, this means that whitespace-mode would happily tell you that there are spaces in your line numbers. (Which is why one might want to use U+00A0.) New display-line-numbers-mode is now properly compatible with whitespace-mode. (See below screenshots.)

linum-mode display-line-numbers-mode
image image

Note also that display-line-numbers-mode doesn't match the style of line numbers with the style of the first character on the line, which is something that has bugged me for a while.

As such, I think we should simply turn off linum-mode on clients with this new functionality, rather than offer the option of choosing, since I think this new functionality is entirely an improvement. But I could see keeping both options around and offering the ability to switch between them.