unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: YE <yet@ego.team>
Cc: Drew Adams <drew.adams@oracle.com>,  help-gnu-emacs@gnu.org
Subject: Re: '(emacs)Init Syntax' customizable minor mode variables
Date: Fri, 12 Aug 2022 04:14:48 +0200	[thread overview]
Message-ID: <87zggadx7r.fsf@web.de> (raw)
In-Reply-To: <m2o7wr6ssh.fsf@ego.team> (YE's message of "Thu, 11 Aug 2022 12:19:58 +0300")

YE <yet@ego.team> writes:

> 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.

In that case they are more than plain Elisp variables, in some sense.

It's good that we have a different name: "(user) options".

> 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.

Note that what I mentioned was only describing one possibility (of a
minority of minor modes).  I think in the majority of cases the setter
just calls the mode function (`custom-set-minor-mode').  Doing "special
things" is probably an exception.

So what you should keep in mind that (setq MODE-VARIABLE VALUE) doesn't
turn the mode in a lot of cases, but Customize is more user friendly (as
a graphical interface), so it takes care of all cases and setting the
mode variable from Customize should always work.  In most cases setting
the mode variable from Customize will just call the mode function.

Michael.




  reply	other threads:[~2022-08-12  2:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-08 12:38 '(emacs)Init Syntax' customizable minor mode variables YE
2022-08-08 14:23 ` [External] : " Drew Adams
2022-08-09 17:08   ` YE
2022-08-11  3:37 ` Michael Heerdegen
2022-08-11  9:19   ` YE
2022-08-12  2:14     ` Michael Heerdegen [this message]
2022-08-12 10:17       ` YE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zggadx7r.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yet@ego.team \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).