unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42222: 26.3; `called-interactively-p' doc is incorrect and misleading
@ 2020-07-05 23:33 Drew Adams
  2020-07-11 10:01 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2020-07-05 23:33 UTC (permalink / raw)
  To: 42222

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#42222: 26.3; `called-interactively-p' doc is incorrect and misleading
  2020-07-05 23:33 bug#42222: 26.3; `called-interactively-p' doc is incorrect and misleading Drew Adams
@ 2020-07-11 10:01 ` Eli Zaretskii
  2020-08-13  0:28   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2020-07-11 10:01 UTC (permalink / raw)
  To: Drew Adams; +Cc: 42222

tags 42222 notabug
thanks

> Date: Sun, 5 Jul 2020 16:33:33 -0700 (PDT)
> From: Drew Adams <drew.adams@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#42222: 26.3; `called-interactively-p' doc is incorrect and misleading
  2020-07-11 10:01 ` Eli Zaretskii
@ 2020-08-13  0:28   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2020-08-13  0:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 42222-done

Eli Zaretskii <eliz@gnu.org> writes:

> There's no bug here.

I'm therefore closing this bug report.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-13  0:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-05 23:33 bug#42222: 26.3; `called-interactively-p' doc is incorrect and misleading Drew Adams
2020-07-11 10:01 ` Eli Zaretskii
2020-08-13  0:28   ` Stefan Kangas

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