From 4caf65d4de591089c82ccf542a31ea5009a3c717 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 7 Jul 2017 12:21:10 +0300 Subject: Fix vertical-motion across the place where line-number width changes * src/indent.c (line_number_display_width): New function, refactored from line-number width calculations in vertical-motion. (Fvertical_motion): Call line_number_display_width when the width of line-number display is needed. (Fline_number_display_width): New defun. (syms_of_indent): Defsubr it. * doc/lispref/display.texi (Size of Displayed Text): Document line-number-display-width. * etc/NEWS: Mention line-number-display-width. * lisp/simple.el (last--line-number-width): New internal variable. (line-move-visual): Use it to adjust temporary-goal-column when line-number display changes its width. --- etc/NEWS | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'etc/NEWS') diff --git a/etc/NEWS b/etc/NEWS index b50c770c505..79eb3919e6d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -420,6 +420,10 @@ line by putting the 'display-line-numbers-disable' text property or overlay property on the first character of that screen line. This is intended for add-on packages that need a finer control of the display. +Lisp programs that need to know how much screen estate is used up for +line-number display in a window can use the new function +'line-number-display-width'. + Linum mode and all similar packages are henceforth becoming obsolete. Users and developers are encouraged to switch to this new feature instead. -- cgit v1.2.1