Subject: bug#64048: 30.0.50; global-display-line-numbers-mode has no easy way to set modes where it is enabled

From: Eli Zaretskii <[email-masked]>
Date: Tue, 13 Jun 2023 18:50:47 +0300

> From: Ihor Radchenko <[email-masked]>
> Date: Tue, 13 Jun 2023 14:33:39 +0000
> 
> global-display-line-numbers-mode is defined as
> 
> (define-globalized-minor-mode global-display-line-numbers-mode
>   display-line-numbers-mode display-line-numbers--turn-on)
> 
> Which unconditionally enables it when `display-line-numbers--turn-on'
> returns t.
> 
> Wouldn't it be nicer to have something like
> 
> (define-globalized-minor-mode global-display-line-numbers-mode
>   display-line-numbers-mode display-line-numbers--turn-on
>   :predicate #'display-line-numbers--turn-on)
> 
> that will also define `display-line-numbers-modes' variable that
> controls where the global mode is enabled/disabled?
> 
> Maybe it should even be the default in `define-globalized-minor-mode'
> when :predicate is not defined.
> 
> WDYT?

I think it's too late for such changes, because it will definitely
break someone's setup.