Subject: Re: bug#37120: [PATCH] Prefer display-line-numbers over linum in docs and custom

From: Stefan Kangas <[email-masked]>
Date: Thu, 22 Aug 2019 15:27:53 +0200

Robert Pluim <[email-masked]> writes:

> All these variables/command should use @code{} rather than explicit quotes, I
> think.

Oops, you are correct of course.  Please find attached a patch fixing that.

Thanks,
Stefan Kangas
From f41ce5b462234d1561c98290fb1e84cb8f7bfb45 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Sat, 1 Jun 2019 01:40:11 +0200
Subject: [PATCH] Prefer display-line-numbers over linum in docs and one
 defcustom

* doc/misc/efaq.texi: Replace linum with display-line-numbers.
* lisp/progmodes/prog-mode.el (prog-mode-hook): Replace linum-mode
with display-line-numbers-mode in :options.  (Bug#37120)
---
 doc/misc/efaq.texi          | 20 +++++++++++++++-----
 lisp/progmodes/prog-mode.el |  3 ++-
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 8fd3bf3a45..df212e43b9 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1687,11 +1687,21 @@ Displaying the current line or column
 this variable.
 
 @cindex Set number capability in @code{vi} emulators
-The @samp{linum} package (distributed with Emacs since version 23.1)
-displays line numbers in the left margin, like the ``set number''
-capability of @code{vi}.  The packages @samp{setnu} and
-@samp{wb-line-number} (not distributed with Emacs) also implement this
-feature.
+The @samp{display-line-numbers} package (added to Emacs in version
+26.1) displays line numbers in the text area, before each line, like
+the ``set number'' capability of @samp{vi}.  Customize the
+buffer-local variable @code{display-line-numbers} to activate this
+optional display.  Alternatively, you can use the
+@code{display-line-numbers-mode} minor mode or the global
+@code{global-display-line-numbers-mode}.  When using these modes,
+customize @code{display-line-numbers-type} with the same value as you
+would use with @code{display-line-numbers}.
+
+There is also the @samp{linum} package (distributed with Emacs since
+version 23.1) which will henceforth become obsolete.  Users and
+developers are encouraged to use @samp{display-line-numbers} instead.
+The packages @samp{setnu} and @samp{wb-line-number} (not distributed
+with Emacs) also implement this feature.
 
 @node Displaying the current file name in the titlebar
 @section How can I modify the titlebar to contain the current file name?
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index cb39e62265..8d3513bad3 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -39,7 +39,8 @@ prog-mode
 (defcustom prog-mode-hook nil
   "Normal hook run when entering programming modes."
   :type 'hook
-  :options '(flyspell-prog-mode abbrev-mode flymake-mode linum-mode
+  :options '(flyspell-prog-mode abbrev-mode flymake-mode
+                                display-line-numbers-mode
                                 prettify-symbols-mode)
   :group 'prog-mode)
 
-- 
2.20.1