diff options
author | Eli Zaretskii <eliz@gnu.org> | 2017-07-06 20:22:16 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2017-07-06 20:22:16 +0300 |
commit | 25bc3911615d1160d47287c023545c6e0587739f (patch) | |
tree | c32eaa3034c93867ae3c820731057505f8fc3f52 /lisp/cus-start.el | |
parent | d5f8a3d03f6c0c98f3280d55a2d88ddb40aa1f3e (diff) | |
download | emacs-25bc3911615d1160d47287c023545c6e0587739f.tar.gz emacs-25bc3911615d1160d47287c023545c6e0587739f.tar.bz2 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 'lisp/cus-start.el')
-rw-r--r-- | lisp/cus-start.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index a89d5dff0cd..017e7f9fa55 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -608,7 +608,14 @@ since it could result in memory overflow and make Emacs crash." :value t) (const :tag "Display zero as number of current line" :value nil)) - "26.1") + "26.1") + (display-line-numbers-widen display + (choice + (const :tag "Disregard narrowing when calculating line numbers" + :value t) + (const :tag "Count lines from beinning of narrowed region" + :value nil)) + "26.1") ;; xfaces.c (scalable-fonts-allowed display boolean "22.1") ;; xfns.c |