all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 37120@debbugs.gnu.org
Subject: bug#37120: [PATCH] Prefer display-line-numbers over linum in docs and custom
Date: Thu, 22 Aug 2019 14:29:58 +0200	[thread overview]
Message-ID: <CADwFkm=yRG3DPqph1xTGDZmDCLRc6TAFEhW2ibqUrYmqgOd3hw@mail.gmail.com> (raw)
In-Reply-To: <83v9uqjwgp.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> I'd prefer "displays line numbers in the text area, before each line".

In the attached patch, the suggested text is changed as you suggest
and extended with details on how to use it.  WDYT?

> ("Left side" is not entirely accurate, because in R2L paragraphs the
> numbers are displayed on the right.)

Good point.

> My point is that neither linum-mode nor display-line-numbers-mode are
> for program sources.  But that's not a very important point, so maybe
> ignore me.

OK, thanks for clarifying.

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Prefer-display-line-numbers-over-linum-in-docs-and-o.patch --]
[-- Type: text/x-patch, Size: 2679 bytes --]

From 0e76a8238b684860eb75f049dffd0c7b4c978272 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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-mode.
* lisp/progmodes/prog-mode.el (prog-mode-hook): Replace linum-mode
with display-line-numbers-mode in :options.
---
 doc/misc/efaq.texi          | 19 ++++++++++++++-----
 lisp/progmodes/prog-mode.el |  3 ++-
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 8fd3bf3a45..67fc05c810 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1687,11 +1687,20 @@ 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 @code{vi}.  Customize the
+buffer-local variable 'display-line-numbers' to activate this optional
+display.  Alternatively, you can use the 'display-line-numbers-mode'
+minor mode or the global 'global-display-line-numbers-mode'.  When
+using these modes, customize 'display-line-numbers-type' with the same
+value as you would use with '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


  reply	other threads:[~2019-08-22 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 17:26 bug#37120: [PATCH] Prefer display-line-numbers over linum in docs and custom Stefan Kangas
2019-08-20 17:58 ` Eli Zaretskii
2019-08-20 18:18   ` Stefan Kangas
2019-08-21 16:48     ` Eli Zaretskii
2019-08-22 12:29       ` Stefan Kangas [this message]
2019-08-22 13:19         ` Robert Pluim
2019-08-22 13:27           ` Stefan Kangas
2019-08-24  6:54             ` Eli Zaretskii
2019-08-27  0:45               ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkm=yRG3DPqph1xTGDZmDCLRc6TAFEhW2ibqUrYmqgOd3hw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=37120@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.