bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28844: 26.0.90; display-line-numbers-mode should call window-configu


From: martin rudalics
Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook
Date: Mon, 16 Oct 2017 09:41:50 +0200

> Simple point movements (for some value of "simple") don't affect the
> width used for line numbers.

Yes.  I forgot that this will affect the window start position as well
in all cases the OP could be interested in.

> I actually don't understand why a hook is needed.  If a Lisp
> application wants/needs to be sensitive to the width of the
> line-number display, it should simply call line-number-display-width
> each time it needs to know the value.  This function is guaranteed to
> return zero when display-line-numbers is nil, and it's also guaranteed
> (barring bugs ;-) to return the exact same value as what the display
> engine will use, provided that the window-start doesn't move between
> the call to line-number-display-width and when you need to use the
> value.  So it will correctly reflect any changes in the width used for
> the line numbers.
>
> What am I missing?

Probably nothing.  IIUC your code also handles adding/removing text that
would increase/decrease the line numbers width while leaving the window
start position alone.

martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]