Subject: bug#79481: global-hl-line buffers

From: Juri Linkov <[email-masked]>
Date: Mon, 22 Sep 2025 09:39:30 +0300

>> Recently we added 'tab-line-exclude-buffers'
>> that is checked by 'buffer-match-p'.
>> 
>> Shouldn't we now rename 'global-hl-line-modes' to something like
>> 'global-hl-line-buffers' and use 'buffer-match-p', given that it was
>> added in 31.1, so there is no need to provide an alias for deprecation.
>
> What is the plan here?  Are we going to do something like that with
> all the globalized modes? only with some of them? if the latter, which
> ones?
>
> IOW, if there's an intent to make similar changes in other minor
> modes, we should probably discuss some general mechanism for doing
> that, before we go out and make the changes one mode at a time.  One
> question that I'd like answered is how come we never needed anything
> like that until now?

One possibility is to add a new keyword like e.g. ':filter'

  (define-globalized-minor-mode global-tab-line-mode
    tab-line-mode tab-line-mode--turn-on
    :filter 'tab-line-exclude-buffers

that will enable buffer-local mode selectively
according to the filter option.

But this could work only for 'define-globalized-minor-mode',
not for global modes that use global hooks like this:

  (define-minor-mode global-hl-line-mode
    :global t
    :filter 'global-hl-line-buffers