help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: '(emacs)Init Syntax' customizable minor mode variables


From: YE
Subject: Re: '(emacs)Init Syntax' customizable minor mode variables
Date: Thu, 11 Aug 2022 12:19:58 +0300

Michael Heerdegen <michael_heerdegen@web.de> writes:

> YE <yet@ego.team> writes:
>
>> Could someone provide an example(s) for the "customizable minor mode
>> variables" that "do special things to enable the mode"?
>
> Enabling a mode has a lot of side effects - it's no surprise that most
> modes can't be enabled by just setting the mode's variable.  Just as
> adding "MODE" to the mode-line won't enable the mode.

That's right. It's hard to comprehend that sentence also because one
normally doesn't expect variables to perform an action, especially "to
enable the mode". Typically, one expects functions to do the action and
variables to store values.

(I suppose it's rightful to say "normally" and "typically" here, looking
from the point of view of an average modern programmer.)

As Drew had already mentioned, part of this confusion comes from the
fact 'defcustom' can not only store values but also do things (':set').
And which frustrates not aware users from time to time (when they try to
change a user option value with an ubiquitous 'setq' but that doesn't
work).

> There are some special examples where setting the mode variable does
> suffice to turn the mode, but that's due to the kind of implementation
> (you can, for example, set up the mode so that it is on, more or less,
> all the time, but permanently watches the variable and does nothing and
> stays silent when the variable is nil).

I find this example helpful, thank you.

Does it mean the word "enable" in that paragraph should be read not as
"turn on the minor mode" but rather "store a state marker for the turned
on minor mode"? If it is so, than the source of my confusion regarding
that sentence is found.

The discussed sentence:
>    Some customizable minor mode variables do special things to enable
> the mode when you set them with Customize, but ordinary ‘setq’ won’t do
> that; to enable the mode in your init file, call the minor mode command.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]