GNU bug report logs -
#24706
26.0.50; Minor mode functions should do strict argument type checking
Previous Next
Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>
Date: Sun, 16 Oct 2016 15:49:01 UTC
Severity: wishlist
Found in version 26.0.50
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 24706 <at> debbugs.gnu.org (full text, mbox):
On Sun, Oct 16, 2016 at 12:12 PM, Drew Adams <drew.adams <at> oracle.com> wrote:
>> (define-minor-mode foo-mode nil)
>> its docstring will be
>>
>> "Toggle Foo mode on or off.
>> With a prefix argument ARG, enable Foo mode if ARG is
>> positive, and disable it otherwise. If called from Lisp, enable
>> the mode if ARG is omitted or nil, and toggle it if ARG is ‘toggle’."
>>
>> This appears to indicate that (foo-mode 'banana)
>> should disable foo-mode, but it enables it.
>
> No, it does not suggest that. But to be clearer, it should
> probably explicitly address the non-nil and non-`toggle' case,
> like so:
>
> If called from Lisp, enable the mode if ARG is omitted or
> nil, toggle it if ARG is ‘toggle’, and disable it if ARG is
> any other non-nil value.
If the Lisp description is meant to be exhaustive by itself, we should
cover the numeric case too:
If called from Lisp, enable the mode if ARG is omitted, nil, or a
positive number; toggle it if ARG is `toggle'; and disable it
otherwise.
This bug report was last modified 4 years and 291 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.