Fixing Slow Scrolling in Emacs display-line-numbers-mode
The display-line-numbers-mode and global-display-line-numbers-mode modes render line numbers in the margin of an Emacs window. Line-number display is implemented in the core C display engine, avoiding the performance cost of legacy Elisp overlays like linum-mode. Despite the native C implementation, and even after configuring Emacs scrolling for better usability, specific configurations can still trigger expensive Lisp evaluations during the interactive command loop, vertical scrolling, and buffer initialization. These settings avoid unnecessary width calculations and initialization scans. Speed comparison across line-number types The display-line-numbers-type variable specifies the type of line numbers activated by display-line-numbers-mode and global-display-line-numbers-mode. It accepts three values: Performance … Continue reading