GNU bug report logs - #42222
26.3; `called-interactively-p' doc is incorrect and misleading

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 5 Jul 2020 23:34:01 UTC

Severity: normal

Tags: notabug

Found in version 26.3

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42222 in the body.
You can then email your comments to 42222 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42222; Package emacs. (Sun, 05 Jul 2020 23:34:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 05 Jul 2020 23:34:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; `called-interactively-p' doc is incorrect and misleading
Date: Sun, 5 Jul 2020 16:33:33 -0700 (PDT)
1. Wrong signature:

     called-interactively-p is a compiled Lisp function in 'subr.el'.

     (called-interactively-p KIND)

   It should be (called-interactively-p &optional KIND).

2. Nothing is said about the case where KIND is absent or nil.

   Nothing is said about the behavior where KIND is anything other than
   `interactive' or `any'.  It seems that it returns nil for anything
   other than those two symbols, regardless of whether the calling
   function was called interactively.

   How misleading is that?  No error - nil (as "false") presumably
   means called non-interatively, but in fact it means nothing in this 
   case.  Result: bugged code, with no help from Emacs about the bug.

3. The same problems exist for the Elisp manual, node `Distinguish
   Interactive'.

4. On the other hand, if the intention really is to _require_ KIND, so
   that what the Elisp manual says is true: "KIND should be either the
   symbol 'interactive' or the symbol 'any'", then the function should
   raise an error when KIND is missing (and the "should" should then
   be changed to "must").

5. This bug seems to still be present in Emacs 28 (recent snapshot).
   There, there's the additional bug that this appears right after the
   first doc-string line, for `C-h f':

     Probably introduced at or before Emacs version 22.1.

   Such meta-information should not be placed up front like that.  It's
   not in any sense the most important info.  If it's shown at all, it
   should be placed at the end, after a horizontal separator.  It's
   essentially a footnote.

   Yes, This (#5) is a separate, unrelated bug.  I don't feel like
   filing it separately.  But it should be fixed.

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''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42222; Package emacs. (Sat, 11 Jul 2020 10:03:01 GMT) Full text and rfc822 format available.

Message #8 received at 42222 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 42222 <at> debbugs.gnu.org
Subject: Re: bug#42222: 26.3;
 `called-interactively-p' doc is incorrect and misleading
Date: Sat, 11 Jul 2020 13:01:46 +0300
tags 42222 notabug
thanks

> Date: Sun, 5 Jul 2020 16:33:33 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> 
> 1. Wrong signature:
> 
>      called-interactively-p is a compiled Lisp function in 'subr.el'.
> 
>      (called-interactively-p KIND)

This is intentional, due to the 'advertised-calling-convention' form.

> 2. Nothing is said about the case where KIND is absent or nil.

See above.

>    Nothing is said about the behavior where KIND is anything other than
>    `interactive' or `any'.

We don't have to.  It means that any other value invokes undefined
behavior.

> 4. On the other hand, if the intention really is to _require_ KIND, so
>    that what the Elisp manual says is true: "KIND should be either the
>    symbol 'interactive' or the symbol 'any'", then the function should
>    raise an error when KIND is missing (and the "should" should then
>    be changed to "must").

Signaling an error is backward-incompatible, so it is not always TRT.

>      Probably introduced at or before Emacs version 22.1.
> 
>    Such meta-information should not be placed up front like that.

We clearly disagree.

There's no bug here.

Thanks.




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 11 Jul 2020 10:03:01 GMT) Full text and rfc822 format available.

Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Thu, 13 Aug 2020 00:30:06 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Thu, 13 Aug 2020 00:30:06 GMT) Full text and rfc822 format available.

Message #15 received at 42222-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42222-done <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#42222: 26.3;
 `called-interactively-p' doc is incorrect and misleading
Date: Wed, 12 Aug 2020 17:28:53 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> There's no bug here.

I'm therefore closing this bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Sep 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 225 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.