From beb95a8f890da611acc1a4422211deafe512d87d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Jun 2017 23:20:49 +0300 Subject: Initial support for visually-relative line numbers Works very slowly. * src/xdisp.c (display_count_lines_visually): New function. (maybe_produce_line_number): Support 'visual' mode of line-number display. * src/xdisp.c (maybe_produce_line_number): Update IT's metrics also when glyph_row is NULL. This is important for move_it_* functions. (syms_of_xdisp) : Now buffer-local. (try_window_id, redisplay_window, try_cursor_movement): For 'visual' line-number display, disable the same redisplay optimizations as for 'relative'. * lisp/cus-start.el (standard): Add new value for the customization form of display-line-numbers. --- lisp/cus-start.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/cus-start.el') diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 773520c64f2..599e7e57f32 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -590,7 +590,9 @@ since it could result in memory overflow and make Emacs crash." (const :tag "Absolute line numbers" :value t) (const :tag "Relative line numbers" - :value relative)) + :value relative) + (const :tag "Visually relative line numbers" + :value visual)) "26.1") (display-line-number-width display (choice -- cgit v1.2.1