diff options
| author | Eli Zaretskii | 2017-07-06 20:22:16 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-07-06 20:22:16 +0300 |
| commit | 25bc3911615d1160d47287c023545c6e0587739f (patch) | |
| tree | c32eaa3034c93867ae3c820731057505f8fc3f52 /doc | |
| parent | d5f8a3d03f6c0c98f3280d55a2d88ddb40aa1f3e (diff) | |
| download | emacs-25bc3911615d1160d47287c023545c6e0587739f.tar.gz emacs-25bc3911615d1160d47287c023545c6e0587739f.zip | |
Implement line numbers that disregard narrowing
* src/xdisp.c (display_count_lines_logically): New function,
counts line numbers disregarding narrowing. Suggested by Andy
Moreton <andrewjmoreton@gmail.com>.
(maybe_produce_line_number): Call display_count_lines_logically
instead of display_count_lines. Adapt BEGV, ZV, etc. to
display-line-numbers-widen.
(syms_of_xdisp) <display-line-numbers-widen>: New buffer-local
variable.
* lisp/cus-start.el (standard): Provide a customization form for
display-line-numbers-widen.
* lisp/frame.el: Add display-line-numbers-widen,
display-line-numbers-current-absolute, and
display-line-number-width to the list of variables that should
trigger redisplay of the current buffer.
* doc/emacs/display.texi (Display Custom): Document
display-line-numbers-widen.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/display.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 61ca7e24f84..083fcdf97a6 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -1756,6 +1756,14 @@ zero. This is handy if you don't care about the number of the current | |||
| 1756 | line, and want to leave more horizontal space for text in large | 1756 | line, and want to leave more horizontal space for text in large |
| 1757 | buffers. | 1757 | buffers. |
| 1758 | 1758 | ||
| 1759 | @vindex display-line-numbers-widen | ||
| 1760 | In a narrowed buffer (@pxref{Narrowing}) lines are normally numbered | ||
| 1761 | starting at the beginning of the narrowing. However, if you customize | ||
| 1762 | the variable @code{display-line-numbers-widen} to a non-@code{nil} | ||
| 1763 | value, line numbers will disregard any narrowing and will start at the | ||
| 1764 | first character of the buffer. | ||
| 1765 | |||
| 1766 | @cindex line-number face | ||
| 1759 | The line numbers are displayed in a special face @code{line-number}. | 1767 | The line numbers are displayed in a special face @code{line-number}. |
| 1760 | The current line number is displayed in a different face, | 1768 | The current line number is displayed in a different face, |
| 1761 | @code{line-number-current-line}, so you can make the current line's | 1769 | @code{line-number-current-line}, so you can make the current line's |