Subject: Re: bug#21507: 25.0.50: (global-SOME-MINOR-MODE) not affecting fundamental mode buffers

From: Stefan Monnier <[email-masked]>
Date: Wed, 26 May 2021 18:41:07 -0400

Lars Ingebrigtsen [2021-05-27 00:33:10] wrote:
> Lars Ingebrigtsen <[email-masked]> writes:
>>> If I tweak my minor mode to be of my2-mode (change the init value to
>>> t)or my3-mode (force the init value to t using setq-default) types
>>> above, then my minor mode gets enabled globally in true sense (even in
>>> buffers created using get-create-buffer).
>>>
>>> In essence, setting the init value as t is not the same as enabling a
>>> globalized minor mode.
>>>
>>> Is this by design? 
>> Anybody know?
> Perhaps Stefan does; added to the CCs.

Maybe I misunderstand the question, but a minor mode is defined by
a function that can used to turn it ON/OFF and a variable that lets you
know where it's ON or OFF.

Setting the var directly rather than via the minor mode function just
breaks the abstraction and its behavior is thus "defined by
implementation" and subject to change.

Similarly `:init-value` is used to tell Emacs what is the initial state,
rather than to set this initial state.

        Stefan