Skip to content

Commit beba135

Browse files
legendre6891bbatsov
authored andcommitted
Use display-line-numbers for Emacs 26.1 and later
PR for #1317 -- use display-line-numbers mode, which is implemented at the C level for speed benefits, if available.
1 parent 5e03876 commit beba135

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### New features
66

7-
* Enable `nlinum-mode` by default. Can be disabled by setting `prelude-minimalistic-ui` to `t`.
7+
* Enable `nlinum-mode` or `display-line-numbers-mode` by default. Can be disabled by setting `prelude-minimalistic-ui` to `t`.
88
* Enable site-wide installation for Prelude.
99
* Auto-installs `julia-mode` if needed.
1010
* Auto-install `adoc-mode` for AsciiDoc files.

core/prelude-ui.el

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@
6262
;; show line numbers at the beginning of each line
6363
(unless prelude-minimalistic-ui
6464
;; there's a built-in linum-mode, but we're using
65-
;; nlinum-mode, as it's supposedly faster
66-
(global-nlinum-mode t))
65+
;; display-line-numbers-mode or nlinum-mode,
66+
;; as it's supposedly faster
67+
(if (fboundp 'global-display-line-numbers-mode)
68+
(global-display-line-numbers-mode)
69+
(global-nlinum-mode t)))
6770

6871
;; enable y/n answers
6972
(fset 'yes-or-no-p 'y-or-n-p)

0 commit comments

Comments
 (0)