From beba1351b5428c0e5185bf8475825abfa2524f6f Mon Sep 17 00:00:00 2001 From: Kevin Li Date: Sat, 13 Feb 2021 08:29:28 -0600 Subject: [PATCH] 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. --- CHANGELOG.md | 2 +- core/prelude-ui.el | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48fa62a7fd..424047111d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### New features -* Enable `nlinum-mode` by default. Can be disabled by setting `prelude-minimalistic-ui` to `t`. +* Enable `nlinum-mode` or `display-line-numbers-mode` by default. Can be disabled by setting `prelude-minimalistic-ui` to `t`. * Enable site-wide installation for Prelude. * Auto-installs `julia-mode` if needed. * Auto-install `adoc-mode` for AsciiDoc files. diff --git a/core/prelude-ui.el b/core/prelude-ui.el index 032d3dde93..fed75fadd2 100644 --- a/core/prelude-ui.el +++ b/core/prelude-ui.el @@ -62,8 +62,11 @@ ;; show line numbers at the beginning of each line (unless prelude-minimalistic-ui ;; there's a built-in linum-mode, but we're using - ;; nlinum-mode, as it's supposedly faster - (global-nlinum-mode t)) + ;; display-line-numbers-mode or nlinum-mode, + ;; as it's supposedly faster + (if (fboundp 'global-display-line-numbers-mode) + (global-display-line-numbers-mode) + (global-nlinum-mode t))) ;; enable y/n answers (fset 'yes-or-no-p 'y-or-n-p)