all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32643: 26; minor-mode variables
@ 2018-09-05 15:13 Drew Adams
  2018-09-06  5:51 ` Richard Stallman
  0 siblings, 1 reply; 23+ messages in thread
From: Drew Adams @ 2018-09-05 15:13 UTC (permalink / raw)
  To: 32643

(emacs) `Minor Modes' says "Most minor modes also have a "mode 
variable", with the same name as the mode command."

It doesn't say why some do and some don't.  Why doesn't it?  What's the
answer to that question?  For example, why doesn't variable
`auto-fill-mode' exist?  Shouldn't all minor modes have a variable?
Which ones should?

Beyond the Emacs manual, (elisp) `Minor Mode Conventions' says this:

  Define a variable whose name ends in '-mode'.  We call this the
  "mode variable".  The minor mode command should set this variable.
  The value will be 'nil' if the mode is disabled, and non-'nil' if
  the mode is enabled.  The variable should be buffer-local if the
  minor mode is buffer-local.

  This variable is used in conjunction with the 'minor-mode-alist' to
  display the minor mode name in the mode line.  It also determines
  whether the minor mode keymap is active, via 'minor-mode-map-alist'
  (*note Controlling Active Maps::).  Individual commands or hooks
  can also check its value.

That says that, by convention, minor modes ahould have a variable.
Isn't it then a bug that some provided by Emacs do not?  And shouldn't
the Elisp manual (and perhaps the Emacs manual) give criteria for when a
minor mode should probably not have a variable?

What's more, the same node about conventions says this:

  Define a command, called the "mode command", whose name is the same
  as the mode variable.  Its job is to set the value of the mode
  variable, plus anything else that needs to be done to actually
  enable or disable the mode's features.

That suggests that the primary job of the mode command is to set the
mode variable.  This suggests strongly that it is a bug not to have a
mode variable.

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-30
Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea
Windowing system distributor `Microsoft Corp.', version 10.0.16299
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2018-09-13 13:28 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-05 15:13 bug#32643: 26; minor-mode variables Drew Adams
2018-09-06  5:51 ` Richard Stallman
2018-09-06 14:18   ` Drew Adams
2018-09-06 14:33     ` Eli Zaretskii
2018-09-08  2:07     ` Noam Postavsky
2018-09-08  2:25       ` Drew Adams
2018-09-09 20:33         ` Noam Postavsky
2018-09-09 22:09           ` Drew Adams
2018-09-12  0:51             ` Noam Postavsky
2018-09-12  1:46               ` Drew Adams
2018-09-13  3:32               ` Richard Stallman
2018-09-13 13:28                 ` Basil L. Contovounesios
2018-09-09  6:05       ` Richard Stallman
2018-09-09 14:12         ` Drew Adams
2018-09-10  7:27           ` Andreas Röhler
     [not found]   ` <<494224f1-815f-4fb4-a779-75e243b519f0@default>
     [not found]     ` <<83sh2mwv8w.fsf@gnu.org>
2018-09-06 14:51       ` Drew Adams
2018-09-06 18:35         ` Eli Zaretskii
     [not found]   ` <<<494224f1-815f-4fb4-a779-75e243b519f0@default>
     [not found]     ` <<<83sh2mwv8w.fsf@gnu.org>
     [not found]       ` <<488f04e4-8389-459b-b3c7-603e48bed452@default>
     [not found]         ` <<83lg8ewk2c.fsf@gnu.org>
2018-09-07  0:10           ` Drew Adams
2018-09-07  6:40             ` Eli Zaretskii
2018-09-08  5:13             ` Richard Stallman
2018-09-08 13:58               ` Drew Adams
2018-09-08 17:53                 ` Andreas Röhler
     [not found]   ` <<<<494224f1-815f-4fb4-a779-75e243b519f0@default>
     [not found]     ` <<<<83sh2mwv8w.fsf@gnu.org>
     [not found]       ` <<<488f04e4-8389-459b-b3c7-603e48bed452@default>
     [not found]         ` <<<83lg8ewk2c.fsf@gnu.org>
     [not found]           ` <<fb9c0be1-c9da-4cf8-aab3-fd54a0a97e68@default>
     [not found]             ` <<83lg8dvmia.fsf@gnu.org>
2018-09-07 15:07               ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.