summaryrefslogtreecommitdiff
path: root/doc/emacs/display.texi
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-06-30 17:33:06 +0300
committerEli Zaretskii <eliz@gnu.org>2017-06-30 17:33:06 +0300
commite83b128a8195e5c63f12832decf70c2953821dc0 (patch)
tree933b90c76986739fba509c6ed720fc1cbd01dd86 /doc/emacs/display.texi
parent7a762fbbfc1c05be8de3d253251f5e7b32da2c73 (diff)
downloademacs-e83b128a8195e5c63f12832decf70c2953821dc0.tar.gz
Add documentation for display-line-numbers
* doc/emacs/custom.texi (Init Rebinding): * doc/emacs/modes.texi (Minor Modes): Remove references to linum-mode. * doc/emacs/display.texi (Display Custom): Describe the line-number display. (Optional Mode Line): Fix the index entry to not conflict with that in "Display Custom". * doc/emacs/basic.texi (Position Info): Add cross-reference to "Display Custom", for line-number display. * src/xdisp.c (syms_of_xdisp): <display-line-numbers>: Mention display-line-numbers-disable in the doc string. * lisp/cus-start.el (standard): Fix lst change.
Diffstat (limited to 'doc/emacs/display.texi')
-rw-r--r--doc/emacs/display.texi54
1 files changed, 53 insertions, 1 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index c4554eb3187..61ca7e24f84 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1333,7 +1333,7 @@ characters in the buffer, which means that @samp{k} for 10^3, @samp{M}
for 10^6, @samp{G} for 10^9, etc., are used to abbreviate.
@cindex line number display
-@cindex display of line number
+@cindex display of current line number
@findex line-number-mode
The current line number of point appears in the mode line when Line
Number mode is enabled. Use the command @kbd{M-x line-number-mode} to
@@ -1710,6 +1710,58 @@ variable @code{visual-line-fringe-indicators}.
This section describes variables that control miscellaneous aspects
of the appearance of the Emacs screen. Beginning users can skip it.
+@vindex display-line-numbers
+@cindex number lines in a buffer
+@cindex display line numbers
+ If you want to have Emacs display line numbers for every line in the
+buffer, customize the buffer-local variable
+@code{display-line-numbers}; it is @code{nil} by default. This
+variable can have several different values to support various modes of
+line-number display:
+
+@table @asis
+@item @code{t}
+Display (an absolute) line number before each non-continuation screen
+line that displays buffer text. If the line is a continuation line,
+or if the entire screen line displays a display or an overlay string,
+that line will not be numbered.
+
+@item @code{relative}
+Display relative line numbers before non-continuation lines which show
+buffer text. The line numbers are relative to the line showing point,
+so the numbers grow both up and down as lines become farther from the
+current line.
+
+@item @code{visual}
+This value causes Emacs to count lines visually: only lines actually
+shown on the display will be counted (disregarding any lines in
+invisible parts of text), and lines which wrap to consume more than
+one screen line will be numbered that many times. The displayed
+numbers are relative, as with @code{relative} value above. This is
+handy in modes that fold text, such as Outline mode (@pxref{Outline
+Mode}), and need to move by exact number of screen lines.
+
+@item anything else
+Any other non-@code{nil} value is treated as @code{t}.
+@end table
+
+@vindex display-line-numbers-current-absolute
+When Emacs displays relative line numbers, you can control the number
+displayed before the current line, the line showing point. By
+default, Emacs displays the absolute number of the current line there,
+even though all the other line numbers are relative. If you customize
+the variable @code{display-line-numbers-current-absolute} to a
+@code{nil} value, the number displayed for the current line will be
+zero. This is handy if you don't care about the number of the current
+line, and want to leave more horizontal space for text in large
+buffers.
+
+The line numbers are displayed in a special face @code{line-number}.
+The current line number is displayed in a different face,
+@code{line-number-current-line}, so you can make the current line's
+number have a distinct appearance, which will help locating the line
+showing point.
+
@vindex visible-bell
If the variable @code{visible-bell} is non-@code{nil}, Emacs attempts
to make the whole screen blink when it would normally make an audible bell