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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Drew Adams <drew.adams@HIDDEN>; Keywords: notabug; dated Sun, 5 Jul 2020 23:34:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) notabug. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 42222 <at> debbugs.gnu.org:


Received: (at 42222) by debbugs.gnu.org; 11 Jul 2020 10:02:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 11 06:02:10 2020
Received: from localhost ([127.0.0.1]:43855 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1juCKf-0000z8-Og
	for submit <at> debbugs.gnu.org; Sat, 11 Jul 2020 06:02:10 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56600)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1juCKd-0000yq-Sa; Sat, 11 Jul 2020 06:02:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53926)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1juCKY-0007Eq-DO; Sat, 11 Jul 2020 06:02:02 -0400
Received: from [176.228.60.248] (port=4755 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1juCKT-0005EF-C6; Sat, 11 Jul 2020 06:02:00 -0400
Date: Sat, 11 Jul 2020 13:01:46 +0300
Message-Id: <83tuyenzed.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-Reply-To: <c09e8a33-1eaa-4b90-8e83-ec0709d93c5b@default> (message from Drew
 Adams on Sun, 5 Jul 2020 16:33:33 -0700 (PDT))
Subject: Re: bug#42222: 26.3;
 `called-interactively-p' doc is incorrect and misleading
References: <c09e8a33-1eaa-4b90-8e83-ec0709d93c5b@default>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 42222
Cc: 42222 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

tags 42222 notabug
thanks

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#42222; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Jul 2020 23:33:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 05 19:33:45 2020
Received: from localhost ([127.0.0.1]:33105 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jsE8n-0000YB-L2
	for submit <at> debbugs.gnu.org; Sun, 05 Jul 2020 19:33:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:39250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1jsE8k-0000Y2-3t
 for submit <at> debbugs.gnu.org; Sun, 05 Jul 2020 19:33:44 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50208)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <drew.adams@HIDDEN>)
 id 1jsE8j-00086S-Rl
 for bug-gnu-emacs@HIDDEN; Sun, 05 Jul 2020 19:33:41 -0400
Received: from aserp2120.oracle.com ([141.146.126.78]:50766)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <drew.adams@HIDDEN>)
 id 1jsE8h-0001Jg-N6
 for bug-gnu-emacs@HIDDEN; Sun, 05 Jul 2020 19:33:41 -0400
Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1])
 by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 065NXZBC188625
 for <bug-gnu-emacs@HIDDEN>; Sun, 5 Jul 2020 23:33:35 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=mime-version :
 message-id : date : from : sender : to : subject : content-type :
 content-transfer-encoding; s=corp-2020-01-29;
 bh=TTufBjk/JpRNVEgpnuUhSRnJ2P2N+Do2f3frTCi7AkI=;
 b=rj8ZiBP2ED/ZbcXhtvYcta9ioBpWt9FQmUnupZYKMl7QlzR4bhJoqAA3ssYF970NLf7y
 tZp1x4OtORwQek68grRF0Q/fD6shTl85SH8fdCmY825J3WAwPS2tNtIAxuo5CctVYwOu
 JjqEvoShJm7KjzT3JhR8ytVoB6sbRmfMW4luSjyN8Dl129ilDAfTJKXL852JyZTEhzER
 T6pGHywNWgNtKmZixlof5JdqR4uM4smCvCQS36bIo1RZtMJNRaTLmFw4VI8FCSW49zzp
 60MFBJJfspN6OFo1/NylHpq/4PSyhq+0uPceA+yjPiiwfXDcOsGZbn9hOYv6LZyNf0fw YQ== 
Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80])
 by aserp2120.oracle.com with ESMTP id 322kv63dpn-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL)
 for <bug-gnu-emacs@HIDDEN>; Sun, 05 Jul 2020 23:33:35 +0000
Received: from pps.filterd (userp3030.oracle.com [127.0.0.1])
 by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 065NS5Gv194287
 for <bug-gnu-emacs@HIDDEN>; Sun, 5 Jul 2020 23:33:35 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by userp3030.oracle.com with ESMTP id 3233pudkkv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Sun, 05 Jul 2020 23:33:35 +0000
Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 065NXY05021156
 for <bug-gnu-emacs@HIDDEN>; Sun, 5 Jul 2020 23:33:34 GMT
MIME-Version: 1.0
Message-ID: <c09e8a33-1eaa-4b90-8e83-ec0709d93c5b@default>
Date: Sun, 5 Jul 2020 16:33:33 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.3; `called-interactively-p' doc is incorrect and misleading
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.5017.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9673
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1
 adultscore=0 spamscore=0
 mlxscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 malwarescore=0
 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000
 definitions=main-2007050182
X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9673
 signatures=668680
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0
 lowpriorityscore=0 bulkscore=0
 malwarescore=0 suspectscore=1 mlxlogscore=999 phishscore=0 spamscore=0
 priorityscore=1501 clxscore=1015 impostorscore=0 mlxscore=0 adultscore=0
 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2004280000 definitions=main-2007050183
Received-SPF: pass client-ip=141.146.126.78;
 envelope-from=drew.adams@HIDDEN; helo=aserp2120.oracle.com
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/05 19:33:36
X-ACL-Warn: Detected OS   = Linux 3.1-3.10 [fuzzy]
X-Spam_score_int: -63
X-Spam_score: -6.4
X-Spam_bar: ------
X-Spam_report: (-6.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

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=20
   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=3Dx86_64-w64-mingw32
 --without-compress-install 'CFLAGS=3D-O2 -static -g3''




Acknowledgement sent to Drew Adams <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#42222; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 11 Jul 2020 10:15:02 UTC

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