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: Paul Rankin
Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook
Date: Sun, 15 Oct 2017 21:08:37 +1000

On Sun, 15 Oct 2017, at 07:41 PM, martin rudalics wrote:
>  > Activating/deactivating display-line-numbers-mode alters the window
>  > configuration and so should call window-configuration-change-hook but
>  > does not.
> 
> ‘window-configuration-change-hook’ is still run way too often, for
> example, when windows get resized.  ‘window-size-change-functions’ might
> be better.  But if you need such a hook, wouldn't you also need it when
> line numbers occupy more or less columns, for example, during scrolling?
> 
> Otherwise, why can't you use ‘display-line-numbers-mode-hook’?

Thanks for pointing me to display-line-numbers-mode-hook, but I’ve found that 
it’s not enough to just check when the mode is enabled. We need to alert other 
concerned modes whenever display-line-numbers-mode changes the margins, e.g. 
due to scrolling from line 99 to 100 (which will increase the width from 2 to 
3).





reply via email to

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