unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41727: 26.3; Doc of `define-minor-mode' and minor-mode commands
@ 2020-06-05 20:39 Drew Adams
  2020-06-06  0:01 ` Drew Adams
  2020-06-06  6:13 ` Eli Zaretskii
  0 siblings, 2 replies; 25+ messages in thread
From: Drew Adams @ 2020-06-05 20:39 UTC (permalink / raw)
  To: 41727

The doc needs improvement when describing calling the mode from Lisp.

1. The doc string of `define-minor-mode' says this:

     When called from Lisp, the mode command toggles the mode if the
     argument is `toggle', disables the mode if the argument is a
     non-positive integer, and enables the mode otherwise (including if
     the argument is omitted or nil or a positive integer).

   This is wrong (incomplete).  It disables the mode if the
   `prefix-numeric-value' of ARG <= 0, not if ARG is a non-positive
   integer.  The code does this: (prefix-numeric-value arg).  So if you
   pass the symbol `-' as ARG then the mode is disabled.

1. The (default) doc string produced by `define-minor-mode' says this:

     If called from Lisp, enable the mode if ARG is omitted or nil, and
     toggle it if ARG is `toggle'.

   Again, this is wrong (incomplete).  It doesn't say that if ARG is
   non-nil other than `toggle' then disable the mode if the
   `prefix-numeric-value' of ARG <= 0, and enable it if the
   `prefix-numeric-value' of ARG > 0.

3. The Elisp manual doc says this (node `Defining Minor Modes'):

     From Lisp, an argument of 'toggle' toggles the mode, whereas an
     omitted or 'nil' argument enables the mode.

   Again, this is wrong (incomplete).

   * It says nothing about how the mode is disabled when called from
     Lisp.  It should say that an ARG whose `prefix-numeric-value' is
     non-positive disables the mode.

   * It should say that an ARG whose `prefix-numeric-value' is
     non-positive enables the mode.


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.18362
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 25+ messages in thread
[parent not found: <<963d4189-17dc-4f4e-9993-0335fa271e50@default>]

end of thread, other threads:[~2021-09-25 17:18 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-05 20:39 bug#41727: 26.3; Doc of `define-minor-mode' and minor-mode commands Drew Adams
2020-06-06  0:01 ` Drew Adams
2020-06-07 10:04   ` Michael Heerdegen
2020-06-07 16:06     ` Drew Adams
2020-06-07 16:19       ` Michael Heerdegen
2020-06-07 16:30         ` Drew Adams
2020-06-06  6:13 ` Eli Zaretskii
2020-06-06 16:45   ` Drew Adams
2020-06-06 18:56     ` Eli Zaretskii
2020-06-07 10:08       ` Michael Heerdegen
2020-06-07 14:31         ` Eli Zaretskii
2020-06-07 14:45           ` Michael Heerdegen
2020-06-07 16:08         ` Drew Adams
     [not found]       ` <<87wo4jb33s.fsf@web.de>
     [not found]         ` <<83y2oz6j6x.fsf@gnu.org>
2020-06-07 16:16           ` Drew Adams
2020-06-08 17:16             ` Michael Heerdegen
2020-06-08 17:38               ` Drew Adams
2020-06-09  7:58                 ` Michael Heerdegen
2020-06-09 14:39                   ` Eli Zaretskii
2020-06-09 15:21                     ` Michael Heerdegen
2020-06-09 15:40                   ` Drew Adams
     [not found]                 ` <<87h7vkbrh3.fsf@web.de>
     [not found]                   ` <<835zc0717e.fsf@gnu.org>
2020-06-09 15:51                     ` Drew Adams
2021-09-25 15:41       ` Stefan Kangas
2021-09-25 16:58         ` bug#41727: [External] : " Drew Adams
2021-09-25 17:18           ` Eli Zaretskii
     [not found] <<963d4189-17dc-4f4e-9993-0335fa271e50@default>
     [not found] ` <<83k10kafha.fsf@gnu.org>
     [not found]   ` <<9d7f8447-1c0b-46db-a40c-c1ed2a398c46@default>
     [not found]     ` <<838sh081lt.fsf@gnu.org>
2020-06-06 20:39       ` Drew Adams

Code repositories for project(s) associated with this public inbox

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

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