GNU bug report logs - #24706
26.0.50; Minor mode functions should do strict argument type checking

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 24706 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: bug#24706: 26.0.50; Minor mode functions should do strict argument type checking
Date: Sun, 02 Aug 2020 19:13:19 +0300
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Date: Sat, 1 Aug 2020 22:47:03 +0200
> Cc: Drew Adams <drew.adams <at> oracle.com>, 24706 <at> debbugs.gnu.org
> 
> Am Mi., 26. Apr. 2017 um 13:27 Uhr schrieb Eli Zaretskii <eliz <at> gnu.org>:
> >
> > > From: Philipp Stephani <p.stephani2 <at> gmail.com>
> > > Date: Sun, 23 Apr 2017 17:51:32 +0000
> > > Cc: drew.adams <at> oracle.com, 24706 <at> debbugs.gnu.org
> > >
> > > Eli Zaretskii <eliz <at> gnu.org> schrieb am So., 16. Okt. 2016 um 20:51 Uhr:
> > >
> > >  > From: Philipp Stephani <p.stephani2 <at> gmail.com>
> > >  > Date: Sun, 16 Oct 2016 18:25:08 +0000

It's hard to have a useful discussion when messages are several months
apart.

> > >  The patch for the ELisp manual simply rearranges the same words, so
> > >  it's not clear to me why we would prefer it to what's already there.
> > >
> > > I don't think there's any repetition or rearranging here.
> >
> > Here's the ELisp manual part of your proposed change:
> >
> >    If the mode command is called from Lisp (i.e., non-interactively), it
> >   -should enable the mode if the argument is omitted or @code{nil}; it
> >   -should toggle the mode if the argument is the symbol @code{toggle};
> >   -otherwise it should treat the argument in the same way as for an
> >   -interactive call with a numeric prefix argument, as described above.
> >   +should toggle the mode if the argument is the symbol @code{toggle}; it
> >   +should disable the mode if the argument is a non-positive integer;
> >   +otherwise, e.g., if the argument is omitted or nil or a positive
> >   +integer, it should enable the mode.
> >
> > Don't you agree that it does little apart of re-shuffling the same
> > words?
> 
> It also describes what happens when the argument is neither nil nor
> `toggle' nor an integer. That is currently unspecified, or rather
> implicitly specified by the observable (but unspecified) behavior of
> `prefix-numeric-value'.

I think the "otherwise" part describes that.

> > > The key difference is that when called from Lisp with an
> > > argument that is neither nil nor an integer, the mode is also enabled.
> >
> > Why would we want to require that?  This subsection describes the
> > conventions, it doesn't describe the effect of certain popular
> > implementation of those conventions, because we don't really want to
> > _require_ modes to behave in any way beyond the described behavior.
> 
> This isn't about the implementation but the interface, i.e. the
> observable behavior of minor mode functions.

I don't see how making this the matter of interface changes anything.
We still don't want to require modes to interpret the interface the
way you'd like to see.

Bottom line: I think there's nothing important left to discuss here.




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.