diff options
| author | Alexander Gramiak | 2017-07-22 12:16:08 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-07-22 12:16:08 +0300 |
| commit | ebb78a7bfa3e6a87cfb53f1f2b17fc2f61add595 (patch) | |
| tree | 4a5e32ce7751b92194e349c5fa76489fd1ce0b6a /etc | |
| parent | 6d7e34b692edd61ac2f0872db521bcec321453cf (diff) | |
| download | emacs-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/NEWS | 44 |
1 files changed, 29 insertions, 15 deletions
| @@ -438,13 +438,18 @@ range of indentation. | |||
| 438 | This is similar to what linum-mode provides, but much faster and | 438 | This is similar to what linum-mode provides, but much faster and |
| 439 | doesn't usurp the display margin for the line numbers. Customize the | 439 | doesn't usurp the display margin for the line numbers. Customize the |
| 440 | buffer-local variable 'display-line-numbers' to activate this optional | 440 | buffer-local variable 'display-line-numbers' to activate this optional |
| 441 | display. If set to t, Emacs will display the number of each line | 441 | display. Alternatively, you can use the `display-line-numbers-mode' |
| 442 | before the line. If set to 'relative', Emacs will display the line | 442 | minor mode or the global `global-display-line-numbers-mode'. When |
| 443 | number relative to the line showing point, with that line's number | 443 | using these modes, customize `display-line-numbers-type' with the same |
| 444 | displayed as absolute. If set to 'visual', Emacs will display a | 444 | value as you would use with `display-line-numbers'. |
| 445 | relative number for every screen line, i.e. it will count screen lines | 445 | |
| 446 | rather than buffer lines. The default is nil, which doesn't display | 446 | If `display-line-numbers' is set to t, Emacs will display the number |
| 447 | the line numbers. | 447 | of each line before the line. If set to 'relative', Emacs will |
| 448 | display the line number relative to the line showing point, with that | ||
| 449 | line's number displayed as absolute. If set to 'visual', Emacs will | ||
| 450 | display a relative number for every screen line, i.e. it will count | ||
| 451 | screen lines rather than buffer lines. The default is nil, which | ||
| 452 | doesn't display the line numbers. | ||
| 448 | 453 | ||
| 449 | In 'relative' and 'visual' modes, the variable | 454 | In '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 | |||
| 462 | current line's number differently from all the other line numbers; by | 467 | current line's number differently from all the other line numbers; by |
| 463 | default these two faces are identical. | 468 | default these two faces are identical. |
| 464 | 469 | ||
| 465 | You can also customize the new variable 'display-line-numbers-width' to | 470 | You can also customize the new buffer-local variable |
| 466 | specify a fixed minimal with of the area allocated to line-number | 471 | 'display-line-numbers-width' to specify a fixed minimal with of the |
| 467 | display. The default is nil, meaning that Emacs will dynamically | 472 | area allocated to line-number display. The default is nil, meaning |
| 468 | calculate the area width, enlarging or shrinking it as needed. | 473 | that Emacs will dynamically calculate the area width, enlarging or |
| 469 | Setting it to a non-negative integer specifies that as the minimal | 474 | shrinking it as needed. Setting it to a non-negative integer |
| 470 | width; selecting a value that is large enough to display all line | 475 | specifies that as the minimal width; selecting a value that is large |
| 471 | numbers in a buffer will then keep the line-number display area of | 476 | enough to display all line numbers in a buffer will then keep the |
| 472 | constant width at all times, if that is desired. | 477 | line-number display area of constant width at all times, if that is |
| 478 | desired. | ||
| 479 | |||
| 480 | When using `display-line-numbers-mode', you can customize the variable | ||
| 481 | `display-line-numbers-grow-only' to a non-nil value; this means that | ||
| 482 | Emacs may grow the above area width dynamically, but never shrink it. | ||
| 483 | Under this mode, customizing the variable | ||
| 484 | `display-line-numbers-width-start' to a non-nil value will cause Emacs | ||
| 485 | to set `display-line-numbers-width' to the minimum width necessary to | ||
| 486 | display all line numbers in the current buffer when first visiting it. | ||
| 473 | 487 | ||
| 474 | Lisp programs can disable line-number display for a particular screen | 488 | Lisp programs can disable line-number display for a particular screen |
| 475 | line by putting the 'display-line-numbers-disable' text property or | 489 | line by putting the 'display-line-numbers-disable' text property or |