GNU bug report logs - #28844
26.0.90; display-line-numbers-mode should call window-configuration-change-hook

Previous Next

Package: emacs;

Reported by: Paul Rankin <hello <at> paulwrankin.com>

Date: Sun, 15 Oct 2017 07:57:01 UTC

Severity: minor

Found in version 26.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #74 received at 28844 <at> debbugs.gnu.org (full text, mbox):

From: Paul Rankin <hello <at> paulwrankin.com>
To: 28844 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org
Subject: 26.0.90; display-line-numbers-mode should call
 window-configuration-change-hook
Date: Fri, 08 Dec 2017 12:14:02 +1000
Eli, I understand that your blindness to this bug is probably due to your own bias. I get it, you wrote the code, you enjoyed the previously mentioned reddit upvotes for it, I understand you don’t want to admit that your code has flaws. But you need to understand that your way of seeing things is subjective and not universal.

The bug is that when the user scrolls up or down, past a point where the width of the line numbers changes from e.g. 99 to the number width from 2 to 3 thus making the width of line number display change from 4 to 5, display-line-numbers-mode necessarily changes the window display configuration to accommodate this character.

However, display-line-numbers-mode doesn’t appear to tell the rest of Emacs about this change, so even if we all wanted to accommodate your display changes, as far as I can tell, we cannot.

It’s nice that you added the token function line-number-display-width, but aside from the bug with its return value being off by 2 (#29597), this function is not useful unless other lisp programs know *when* to call it.

The easiest solution, the one that baffles me why you haven’t just included already rather than continue to argue with me, is that when display-line-numbers-mode changes the window, you run window-configuration-change-hook.

If, for some Eli-reason, you don’t want to run window-configuration-change-hook, you can add a simple hook, which gets run whenever display-line-numbers-mode needs to change the window configuration. Then other lisp programs can call line-number-display-width, and provided its bug gets fixed and it returns the correct width, everyone is happy.

Is there anything about this that’s not clear to you?




This bug report was last modified 7 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.