aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorAlexander Gramiak2017-07-22 12:16:08 +0300
committerEli Zaretskii2017-07-22 12:16:08 +0300
commitebb78a7bfa3e6a87cfb53f1f2b17fc2f61add595 (patch)
tree4a5e32ce7751b92194e349c5fa76489fd1ce0b6a /etc
parent6d7e34b692edd61ac2f0872db521bcec321453cf (diff)
downloademacs-ebb78a7bfa3e6a87cfb53f1f2b17fc2f61add595.tar.gz
emacs-ebb78a7bfa3e6a87cfb53f1f2b17fc2f61add595.zip
Add a minor mode interface for display-line-numbers
* lisp/cus-start.el: Use the new display-line-numbers group. * lisp/display-line-numbers.el: New file. * 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. * src/xdisp.c (syms_of_xdisp) <display-line-numbers-width>: Fix a typo.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS44
1 files changed, 29 insertions, 15 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 04971544d36..50945f0cfa3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -438,13 +438,18 @@ range of indentation.
438This is similar to what linum-mode provides, but much faster and 438This is similar to what linum-mode provides, but much faster and
439doesn't usurp the display margin for the line numbers. Customize the 439doesn't usurp the display margin for the line numbers. Customize the
440buffer-local variable 'display-line-numbers' to activate this optional 440buffer-local variable 'display-line-numbers' to activate this optional
441display. If set to t, Emacs will display the number of each line 441display. Alternatively, you can use the `display-line-numbers-mode'
442before the line. If set to 'relative', Emacs will display the line 442minor mode or the global `global-display-line-numbers-mode'. When
443number relative to the line showing point, with that line's number 443using these modes, customize `display-line-numbers-type' with the same
444displayed as absolute. If set to 'visual', Emacs will display a 444value as you would use with `display-line-numbers'.
445relative number for every screen line, i.e. it will count screen lines 445
446rather than buffer lines. The default is nil, which doesn't display 446If `display-line-numbers' is set to t, Emacs will display the number
447the line numbers. 447of each line before the line. If set to 'relative', Emacs will
448display the line number relative to the line showing point, with that
449line's number displayed as absolute. If set to 'visual', Emacs will
450display a relative number for every screen line, i.e. it will count
451screen lines rather than buffer lines. The default is nil, which
452doesn't display the line numbers.
448 453
449In 'relative' and 'visual' modes, the variable 454In 'relative' and 'visual' modes, the variable
450'display-line-numbers-current-absolute' controls what number is 455'display-line-numbers-current-absolute' controls what number is
@@ -462,14 +467,23 @@ new face 'line-number-current-line' can be customized to display the
462current line's number differently from all the other line numbers; by 467current line's number differently from all the other line numbers; by
463default these two faces are identical. 468default these two faces are identical.
464 469
465You can also customize the new variable 'display-line-numbers-width' to 470You can also customize the new buffer-local variable
466specify a fixed minimal with of the area allocated to line-number 471'display-line-numbers-width' to specify a fixed minimal with of the
467display. The default is nil, meaning that Emacs will dynamically 472area allocated to line-number display. The default is nil, meaning
468calculate the area width, enlarging or shrinking it as needed. 473that Emacs will dynamically calculate the area width, enlarging or
469Setting it to a non-negative integer specifies that as the minimal 474shrinking it as needed. Setting it to a non-negative integer
470width; selecting a value that is large enough to display all line 475specifies that as the minimal width; selecting a value that is large
471numbers in a buffer will then keep the line-number display area of 476enough to display all line numbers in a buffer will then keep the
472constant width at all times, if that is desired. 477line-number display area of constant width at all times, if that is
478desired.
479
480When using `display-line-numbers-mode', you can customize the variable
481`display-line-numbers-grow-only' to a non-nil value; this means that
482Emacs may grow the above area width dynamically, but never shrink it.
483Under this mode, customizing the variable
484`display-line-numbers-width-start' to a non-nil value will cause Emacs
485to set `display-line-numbers-width' to the minimum width necessary to
486display all line numbers in the current buffer when first visiting it.
473 487
474Lisp programs can disable line-number display for a particular screen 488Lisp programs can disable line-number display for a particular screen
475line by putting the 'display-line-numbers-disable' text property or 489line by putting the 'display-line-numbers-disable' text property or