1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-27 10:54:40 +00:00

Minor tweaks of new line number display variables

* src/xdisp.c (Vdisplay_line_numbers): Tweak doc-string.
(Vdisplay_line_number_width): Rename to
Vdisplay_line_numbers_width.
(maybe_produce_line_number): Comply with above rename.
* lisp/cus-start.el (standard):
* lisp/frame.el (top-level):
* etc/NEWS: Comply with renaming of
`display-line-number-width' to `display-line-numbers-width'.
This commit is contained in:
Martin Rudalics 2017-07-12 17:35:31 +02:00
parent 4ddff36f6a
commit 01a98e918d
4 changed files with 24 additions and 21 deletions

View File

@ -442,7 +442,7 @@ 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-number-width' to
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.

View File

@ -594,7 +594,7 @@ since it could result in memory overflow and make Emacs crash."
(const :tag "Visually relative line numbers"
:value visual))
"26.1")
(display-line-number-width display
(display-line-numbers-width display
(choice
(const :tag "Dynamically computed"
:value nil)

View File

@ -2473,7 +2473,7 @@ See also `toggle-frame-maximized'."
wrap-prefix
truncate-lines
display-line-numbers
display-line-number-width
display-line-numbers-width
display-line-numbers-current-absolute
display-line-numbers-widen
bidi-paragraph-direction

View File

@ -20904,8 +20904,8 @@ maybe_produce_line_number (struct it *it)
/* Compute the required width if needed. */
if (!it->lnum_width)
{
if (NATNUMP (Vdisplay_line_number_width))
it->lnum_width = XFASTINT (Vdisplay_line_number_width);
if (NATNUMP (Vdisplay_line_numbers_width))
it->lnum_width = XFASTINT (Vdisplay_line_numbers_width);
/* Max line number to be displayed cannot be more than the one
corresponding to the last row of the desired matrix. */
@ -32686,35 +32686,38 @@ To add a prefix to continuation lines, use `wrap-prefix'. */);
DEFVAR_LISP ("display-line-numbers", Vdisplay_line_numbers,
doc: /* Non-nil means display line numbers.
If the value is t, display absolute line numbers starting at the
beginning of the current narrowing, or at buffer beginning.
If the value is `relative', display line numbers relative to the
line showing point.
The value `visual' countse lative screen lines rather than
physical line: by default, line numbers are displayed before each
non-continuation line that displays buffer text, i.e. after each
newline that came from buffer text. However, if the value is `visual',
every screen line will have a number.
If the value is t, display the absolute number of each line of a buffer
shown in a window. Absolute line numbers count from the beginning of
the current narrowing, or from buffer beginning. If the value is
`relative', display for each line not containing the window's point its
relative number instead, i.e. the number of the line relative to the
line showing the window's point.
In either case, line numbers are displayed at the beginning of each
non-continuation line that displays buffer text, i.e. after each newline
character that comes from the buffer. The value `visual' is like
`relative' but counts screen lines instead of buffer lines. In practice
this means that continuation lines count as well when calculating the
relative number of a line.
Lisp programs can disable display of a line number of a particular
screen line by putting the `display-line-numbers-disable' text
property or overlay property on the first visible character of
that line. */);
buffer line by putting the `display-line-numbers-disable' text property
or overlay property on the first visible character of that line. */);
Vdisplay_line_numbers = Qnil;
DEFSYM (Qdisplay_line_numbers, "display-line-numbers");
Fmake_variable_buffer_local (Qdisplay_line_numbers);
DEFSYM (Qrelative, "relative");
DEFSYM (Qvisual, "visual");
DEFVAR_LISP ("display-line-number-width", Vdisplay_line_number_width,
DEFVAR_LISP ("display-line-numbers-width", Vdisplay_line_numbers_width,
doc: /* Minimum width of space reserved for line number display.
A positive number means reserve that many columns for line numbers,
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_number_width = Qnil;
DEFSYM (Qdisplay_line_number_width, "display-line-number-width");
Fmake_variable_buffer_local (Qdisplay_line_number_width);
Vdisplay_line_numbers_width = Qnil;
DEFSYM (Qdisplay_line_numbers_width, "display-line-number-width");
Fmake_variable_buffer_local (Qdisplay_line_numbers_width);
DEFVAR_LISP ("display-line-numbers-current-absolute",
Vdisplay_line_numbers_current_absolute,