GNU bug report logs -
#44341
27.1; define-minor-mode generates inaccurate docstring
Previous Next
Reported by: Thibault Polge <thibault <at> thb.lt>
Date: Sat, 31 Oct 2020 11:01:02 UTC
Severity: normal
Tags: fixed
Found in version 27.1
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #15 received at 44341 <at> debbugs.gnu.org (full text, mbox):
> (mapcar
> (lambda (x) (test-mode x) (cons x test-mode))
> '(t ; Should disable.
An argument of the form t has traditionally enabled the mode.
Many .emacs file have calls like (foo-mode t), so we need to preserve this.
> nil ; Should disable
The argument nil should definitely enable the mode.
> -33 ; Should NOT disable (but will)
> 33 ; Should enable
Negative and positive are the "canonical" way to disable and enable
a mode, no -33 should disable and 33 should enable.
> 0 ; Should disable
Historically, 0 has been defined to disable the mode, indeed.
I recommend to use -1 instead, but a lot of code uses 0.
> toggle ; Should toggle, and will.
> toggle ; Repeated for confirmation
Right.
> disable ; Should disable (as a random symbol)
> disable ; Again
> "What?" ; Same.
These should be considered as errors. Whether we catch them and signal
an error or silently do something else is not particular important
to me. But we shouldn't document the behavior for those arguments as
being anything else than errors.
Stefan
This bug report was last modified 4 years and 294 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.