all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Native line numbers landed on master
Date: Mon, 17 Jul 2017 14:34:17 -0600	[thread overview]
Message-ID: <87pocyiz06.fsf@lylat> (raw)
In-Reply-To: <83poczcdlz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 17 Jul 2017 18:00:40 +0300")

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

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alex <agrambot@gmail.com>
>> Cc: emacs-devel@gnu.org
>> Date: Sun, 16 Jul 2017 13:31:52 -0600
>> 
>> > All else being equal, I think having as much as possible in
>> > display-line-numbers.el would be better, as it avoids scattering
>> > related stuff across different files.
>> 
>> I agree. Here's an updated patch that includes this as well as other
>> improvements:
>
> LGTM, thanks.  How about updating the manual and NEWS as well?

Sure, I've done that in [1]. I've also fixed a DEFSYM issue that was
caused by the rename from display-line-number-width to
display-line-numbers-width in patch [2]

Footnotes: 
[1]  

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: document --]
[-- Type: text/x-diff, Size: 5377 bytes --]

From 7a9aacd3a4d5f0a98050502f624aea3cbb4e6ce0 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Mon, 17 Jul 2017 14:14:45 -0600
Subject: [PATCH] Document display-line-numbers-mode

* doc/emacs/custom.texi (Init Rebinding): Re-add entry that used to
belong to linum-mode.
* doc/emacs/modes.texi (Minor Modes): Summarize the mode.
* etc/NEWS: Document display-line-numbers-mode and its customization
variables, and mention that display-line-numbers-width is
buffer-local.
---
 doc/emacs/custom.texi |  1 +
 doc/emacs/modes.texi  |  7 +++++++
 etc/NEWS              | 44 +++++++++++++++++++++++++++++---------------
 3 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index a756a89e3f..1c9c14a962 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1701,6 +1701,7 @@ Init Rebinding
 (global-set-key (kbd "C-c y") 'clipboard-yank)
 (global-set-key (kbd "C-M-q") 'query-replace)
 (global-set-key (kbd "<f5>") 'flyspell-mode)
+(global-set-key (kbd "C-<f5>") 'display-line-numbers-mode)
 (global-set-key (kbd "C-<right>") 'forward-sentence)
 (global-set-key (kbd "<mouse-2>") 'mouse-save-then-kill)
 @end example
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index eb0c88b290..876431aa9e 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -225,6 +225,13 @@ Minor Modes
 programs.  It is enabled globally by default, but you can disable it
 in individual buffers.  @xref{Faces}.
 
+@findex display-line-numbers-mode
+@cindex display-line-numbers-mode
+@item
+Display Line Numbers mode is a convenience wrapper around
+@code{display-line-numbers}, setting it using the value of
+@code{display-line-numbers-type}.  @xref{Display Custom}.
+
 @item
 Outline minor mode provides similar facilities to the major mode
 called Outline mode.  @xref{Outline Mode}.
diff --git a/etc/NEWS b/etc/NEWS
index edb71118ef..ccc9984c4c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -424,13 +424,18 @@ range of indentation.
 This is similar to what linum-mode provides, but much faster and
 doesn't usurp the display margin for the line numbers.  Customize the
 buffer-local variable 'display-line-numbers' to activate this optional
-display.  If set to t, Emacs will display the number of each line
-before the line.  If set to 'relative', Emacs will display the line
-number relative to the line showing point, with that line's number
-displayed as absolute.  If set to 'visual', Emacs will display a
-relative number for every screen line, i.e. it will count screen lines
-rather than buffer lines.  The default is nil, which doesn't display
-the line numbers.
+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'.
+
+If `display-line-numbers' is set to t, Emacs will display the number
+of each line before the line.  If set to 'relative', Emacs will
+display the line number relative to the line showing point, with that
+line's number displayed as absolute.  If set to 'visual', Emacs will
+display a relative number for every screen line, i.e. it will count
+screen lines rather than buffer lines.  The default is nil, which
+doesn't display the line numbers.
 
 In 'relative' and 'visual' modes, the variable
 'display-line-numbers-current-absolute' controls what number is
@@ -448,14 +453,23 @@ new face 'line-number-current-line' can be customized to display the
 current line's number differently from all the other line numbers; by
 default these two faces are identical.
 
-You can also customize the new variable 'display-line-numbers-width' to
-specify a fixed minimal with of the area allocated to line-number
-display.  The default is nil, meaning that Emacs will dynamically
-calculate the area width, enlarging or shrinking it as needed.
-Setting it to a non-negative integer specifies that as the minimal
-width; selecting a value  that is large enough to display all line
-numbers in a buffer will then keep the line-number display area of
-constant width at all times, if that is desired.
+You can also customize the new buffer-local variable
+'display-line-numbers-width' to specify a fixed minimal with of the
+area allocated to line-number display.  The default is nil, meaning
+that Emacs will dynamically calculate the area width, enlarging or
+shrinking it as needed.  Setting it to a non-negative integer
+specifies that as the minimal width; selecting a value that is large
+enough to display all line numbers in a buffer will then keep the
+line-number display area of constant width at all times, if that is
+desired.
+
+When using `display-line-numbers-mode', you can customize the variable
+`display-line-numbers-grow-only' to a non-nil value; this means that
+Emacs may grow the above area width dynamically, but never shrink it.
+Under this mode, customizing the variable
+`display-line-numbers-width-start' to a non-nil value will cause Emacs
+to set `display-line-numbers-width' to the minimum width necessary to
+display all line numbers in the current buffer when first visiting it.
 
 Lisp programs can disable line-number display for a particular screen
 line by putting the 'display-line-numbers-disable' text property or
-- 
2.13.2


[-- Attachment #3: Type: text/plain, Size: 6 bytes --]


[2]  

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: rename --]
[-- Type: text/x-diff, Size: 894 bytes --]

From 1d85de761577540ba5a85a39d91f6b3cf221b948 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Mon, 17 Jul 2017 14:12:24 -0600
Subject: [PATCH] * src/xdisp.c (syms_of_xdisp): Fix renaming omission

---
 src/xdisp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xdisp.c b/src/xdisp.c
index 2aceb89c00..5e594347f0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -32718,7 +32718,7 @@ even if the actual number needs less space.
 The default value of nil means compute the space dynamically.
 Any other value is treated as nil.  */);
   Vdisplay_line_numbers_width = Qnil;
-  DEFSYM (Qdisplay_line_numbers_width, "display-line-number-width");
+  DEFSYM (Qdisplay_line_numbers_width, "display-line-numbers-width");
   Fmake_variable_buffer_local (Qdisplay_line_numbers_width);
 
   DEFVAR_LISP ("display-line-numbers-current-absolute",
-- 
2.13.2


  reply	other threads:[~2017-07-17 20:34 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08  7:58 Native line numbers landed on master Eli Zaretskii
2017-07-08  8:41 ` martin rudalics
2017-07-08 10:23   ` Eli Zaretskii
2017-07-08 22:38 ` Alex
2017-07-09 14:22   ` Eli Zaretskii
2017-07-09 22:56     ` Alex
2017-07-10 17:50       ` Eli Zaretskii
2017-07-10 20:31         ` Alex
2017-07-11 15:12           ` Eli Zaretskii
2017-07-11 20:44             ` Alex
2017-07-12 14:40               ` Eli Zaretskii
2017-07-16  7:30                 ` Alex
2017-07-16 14:10                   ` Eli Zaretskii
2017-07-16 19:31                     ` Alex
2017-07-17 15:00                       ` Eli Zaretskii
2017-07-17 20:34                         ` Alex [this message]
2017-07-22  9:18                           ` Eli Zaretskii
2017-07-10 22:19     ` John Wiegley
2017-07-11  2:29       ` Eli Zaretskii
2017-07-11 15:27     ` Stefan Monnier
2017-07-11 16:04       ` Eli Zaretskii
2017-07-11 16:16         ` Stefan Monnier
2017-07-11 17:23           ` Eli Zaretskii
2017-07-11 17:48             ` Stefan Monnier
2017-07-11 18:04               ` Eli Zaretskii
2017-07-11 18:19                 ` Stefan Monnier
2017-07-11 18:18               ` Sharp-quoting function symbols (Was: Native line numbers landed on master) Kaushal Modi
2017-09-30 18:36                 ` Philipp Stephani
2017-12-30 21:09                   ` Philipp Stephani
2017-07-10 16:51 ` Native line numbers landed on master Filipe Silva
2017-07-11 13:00 ` Robert Pluim
2017-07-11 13:37   ` Jean-Christophe Helary
2017-07-11 13:47     ` Robert Pluim
2017-07-11 14:19       ` Jean-Christophe Helary
2017-07-11 15:24   ` Eli Zaretskii
2017-07-11 15:29     ` Robert Pluim
2017-07-11 16:07       ` Eli Zaretskii
2017-07-11 16:12         ` Robert Pluim
2017-07-11 17:33           ` Eli Zaretskii
2017-07-12  3:23 ` Kaushal Modi
2017-07-12  7:11   ` martin rudalics
2017-07-12 14:27     ` Eli Zaretskii
2017-07-12 15:49       ` martin rudalics
2017-07-15 22:02 ` Yuri D'Elia
2017-07-16  2:34   ` Eli Zaretskii
2017-07-16 14:25     ` Eli Zaretskii
2017-07-17  9:44       ` Yuri D'Elia
2017-07-17 14:16         ` Eli Zaretskii
2019-06-10  2:46   ` Juanma Barranquero
2019-06-10  8:32     ` Yuri D'Elia
2019-06-10 12:38       ` Juanma Barranquero
2019-06-10 15:22     ` Eli Zaretskii
2019-06-10 15:32       ` Juanma Barranquero
2019-06-10 15:33       ` Yuri D'Elia
2019-06-10 15:54         ` Eli Zaretskii
2019-06-10 16:23           ` Yuri D'Elia
2019-06-10 17:41             ` Eli Zaretskii
2019-09-30 10:01               ` Juanma Barranquero
2019-09-30 10:21                 ` Eli Zaretskii
2019-10-01  5:44                   ` Juanma Barranquero
2019-10-01  7:05                     ` Eli Zaretskii
2019-10-01  8:49                       ` Juanma Barranquero
2019-10-01  8:55                         ` Juanma Barranquero
2019-10-01  9:26                           ` Eli Zaretskii
2019-10-01  9:25                         ` Eli Zaretskii
2019-10-01  9:09                     ` Yuri D'Elia
2019-10-01  9:21                       ` Juanma Barranquero
2019-10-01  9:51                         ` Yuri D'Elia
2019-10-01 10:23                           ` Juanma Barranquero
2019-10-01 10:40                             ` Yuri D'Elia
2019-10-01 10:39                           ` Eli Zaretskii
2019-10-01 10:47                         ` Lars Ingebrigtsen
2019-10-01 11:07                           ` Eli Zaretskii
2019-10-01 11:11                           ` Juanma Barranquero
2019-10-01 22:52                             ` Ergus
2019-10-01 23:51                               ` Juanma Barranquero
2019-10-02  3:41                                 ` Ergus
2019-10-02  9:40                                   ` Juanma Barranquero
2019-10-02 13:56                                     ` Ergus
2019-10-02 15:06                                 ` Eli Zaretskii
2019-10-03  4:11                                   ` Juanma Barranquero
2019-10-03  8:16                                     ` martin rudalics
2019-10-03 14:43                                       ` Juanma Barranquero
2019-10-03  9:10                                     ` Robert Pluim
2019-10-03 14:47                                       ` Juanma Barranquero
2019-10-03 15:18                                         ` Robert Pluim
2019-10-03 20:37                                         ` Stefan Kangas
2019-10-03 21:48                                           ` Juanma Barranquero
2019-10-03 22:37                                             ` Yuri D'Elia
2019-10-04  1:51                                               ` Juanma Barranquero
2019-10-04  7:45                                                 ` Eli Zaretskii
2019-10-04  9:52                                                   ` Yuri D'Elia
2019-10-04 10:24                                                     ` Juanma Barranquero
2019-10-05  6:26                                                     ` Juanma Barranquero
2019-10-07  0:14                                                       ` Juanma Barranquero
2019-10-07  6:54                                                         ` Robert Pluim
2019-10-07  7:39                                                           ` Juanma Barranquero
2019-10-07  8:09                                                             ` Robert Pluim
2019-10-07  8:39                                                               ` Juanma Barranquero
2019-10-07 18:52                                                                 ` Juri Linkov
2019-10-08  0:57                                                                   ` Juanma Barranquero
2019-10-19 20:38                                                                     ` Juri Linkov
2019-10-07 16:30                                                               ` Eli Zaretskii
2019-10-08 11:15                                                                 ` Robert Pluim
2019-10-08 12:23                                                                   ` Eli Zaretskii
2019-10-09  7:19                                                                     ` Robert Pluim
2019-10-09  8:16                                                                       ` Eli Zaretskii
2019-10-09 12:14                                                                         ` Robert Pluim
2019-10-09 12:23                                                                           ` Eli Zaretskii
2019-10-09 13:19                                                                             ` Robert Pluim
2019-10-09 10:51                                                         ` Juanma Barranquero
2019-10-04 10:22                                                   ` Ergus
2019-10-04 10:26                                                     ` Juanma Barranquero
2019-10-03 12:28                                     ` Yuri Khan
2019-10-03 14:48                                       ` Juanma Barranquero
2019-10-03 17:56                                         ` Yuri D'Elia
2019-10-03 18:40                                           ` Eli Zaretskii
2019-10-03 19:01                                             ` Yuri D'Elia
2019-10-04  2:01                                             ` Juanma Barranquero
2019-10-04  5:01                                               ` Juanma Barranquero
2019-10-04 15:57                                                 ` Johan Bockgård
2019-10-04 17:28                                                   ` Juanma Barranquero
2019-10-04 19:24                                                     ` Stefan Monnier
2019-10-04 20:12                                                       ` Yuri D'Elia
2019-10-04 22:45                                                         ` Juanma Barranquero
2019-10-06 14:04                                                           ` Juanma Barranquero
2019-10-06 14:45                                                             ` Juanma Barranquero
2019-10-06 18:02                                                             ` Eli Zaretskii
2019-10-01  9:24                       ` Eli Zaretskii

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=87pocyiz06.fsf@lylat \
    --to=agrambot@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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.