Subject: bug#28844: 26.0.90; display-line-numbers-mode should call window-configuration-change-hook

From: Paul Rankin <[email-masked]>
Date: Mon, 16 Oct 2017 15:14:10 +1000

On Mon, 16 Oct 2017, at 02:59 PM, Alex wrote:
> Actually, I'd recommend (boundp 'display-line-numbers), since the
> feature `display-line-numbers' isn't loaded automatically in Emacs. It
> should be noted that `display-line-numbers-mode' is just a minor mode
> wrapper around the variable `display-line-numbers', which actually does
> the work.
> 
> This also means that the hook `display-line-numbers-hook' isn't actually
> enough to determine whether or not line numbers have been toggled (since
> one can just toggle the variable instead). I'd say its main use is in
> user configurations.
> 
> To see if line numbers are present in a buffer (and to make it
> compatible with older Emacsen), you should use something like:
> 
> (bound-and-true-p display-line-numbers)

Sweet, thanks! I’ve encountered another bug with this mode #28855, so I think until it gets its house in order, the best thing to go with is:
(if (bound-and-true-p display-line-numbers) (display-line-numbers-mode 0))

I’ve just discovered that linum-mode.el has been fixed to respect existing margins, so big love & thanks to whoever did that work. So, if linum-mode can be a good lisp citizen, so too can display-line-numbers-mode!