GNU bug report logs - #66991
Confusion in interactive-form with commands with bare interactive forms.

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: Alan Mackenzie <acm@HIDDEN>; dated Tue, 7 Nov 2023 16:40:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 66991) by debbugs.gnu.org; 8 Nov 2023 12:30:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 08 07:30:00 2023
Received: from localhost ([127.0.0.1]:44156 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0hh2-0002IM-GX
	for submit <at> debbugs.gnu.org; Wed, 08 Nov 2023 07:30:00 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38230)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1r0hgy-0002I5-Ms
 for 66991 <at> debbugs.gnu.org; Wed, 08 Nov 2023 07:29:59 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 70CF4806F7;
 Wed,  8 Nov 2023 07:29:12 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699446551;
 bh=ViZhMwYk9V01vw+Au0xPU5WFpDurkxUY73HaCLBfKS8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=TkAllSzwcEDzFoXwJtuEqEkmM76tSbE9IpiNbOLy1QNoCFVQ/3yd7ezcgizuNhJ+r
 tPNuESU0HXapxC9LGSti9C4bwowjsGOX+qruXiUTeWhP8jKNWe8jAGgv3Swoy47yJ4
 xLLa4pdHMxYMKKFZ27dHFrSUHnWnbO8AYEIu5OgHaBF7AeU551CkRq91S124Df6cjZ
 W8Sp+Q0mIrILkHFYLV6tZvX4ps9jvYBJ86alDyOQT9wjysgCmWJ4J2Wq+7Kx5WMioP
 TeH67HnskQHaoWnWKCggtiroozv+YlJpBnRgxmqP1KgPgy17LYWRrB7deUrNUPlUDe
 MLZORy0nxcJ3Q==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A602B8025F;
 Wed,  8 Nov 2023 07:29:11 -0500 (EST)
Received: from pastel (unknown [45.72.227.120])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7D59C12031F;
 Wed,  8 Nov 2023 07:29:11 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#66991: Confusion in interactive-form with commands with
 bare interactive forms.
In-Reply-To: <ZUtNSpB2H4pGcArQ@ACM> (Alan Mackenzie's message of "Wed, 8 Nov
 2023 08:56:42 +0000")
Message-ID: <jwv1qd01lmy.fsf-monnier+emacs@HIDDEN>
References: <ZUpoGwHli-EqtLk8@ACM> <83wmut1pb1.fsf@HIDDEN>
 <ZUpvapul64hc0svD@ACM> <jwv5y2d31u6.fsf-monnier+emacs@HIDDEN>
 <ZUtNSpB2H4pGcArQ@ACM>
Date: Wed, 08 Nov 2023 07:29:10 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.017 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66991
Cc: Eli Zaretskii <eliz@HIDDEN>, 66991 <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 (---)

> What about replacing (interactive "") with (interactive) too, and
> documenting this?

Why?

> The doc string says that "Return the interactive form of CMD, or nil
> ....".  But you seem to be arguing that there is no unique _THE_
> interactive form.

The interactive form is either a string or code.  When it's a string,
I expect you get the one and only `(interactive THE-STRING)`, but when
it's not a string ... well ... by definition the compiler changes the
representation of code so it's completely expected that you won't get
necessarily quite the same code (as long as its execution is equivalent).

> The doc string doesn't make this clear, and needs amending anyway.

Maybe, but I don't understand why you think it's necessary.

> To fix only the doc string rather than the code too, would double the
> doc string's size.

And this suggests we should also document `symbol-function` to say that
it may not return something identical to what you wrote in the
source code.


        Stefan





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

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


Received: (at 66991) by debbugs.gnu.org; 8 Nov 2023 08:57:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 08 03:57:31 2023
Received: from localhost ([127.0.0.1]:43986 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0eNO-0002Gw-P8
	for submit <at> debbugs.gnu.org; Wed, 08 Nov 2023 03:57:31 -0500
Received: from mail.muc.de ([193.149.48.3]:60935)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r0eNM-0002Ge-6Y
 for 66991 <at> debbugs.gnu.org; Wed, 08 Nov 2023 03:57:28 -0500
Received: (qmail 91342 invoked by uid 3782); 8 Nov 2023 09:56:43 +0100
Received: from acm.muc.de (p4fe1584b.dip0.t-ipconnect.de [79.225.88.75])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 08 Nov 2023 09:56:42 +0100
Received: (qmail 21734 invoked by uid 1000); 8 Nov 2023 08:56:42 -0000
Date: Wed, 8 Nov 2023 08:56:42 +0000
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#66991: Confusion in interactive-form with commands with bare
 interactive forms.
Message-ID: <ZUtNSpB2H4pGcArQ@ACM>
References: <ZUpoGwHli-EqtLk8@ACM> <83wmut1pb1.fsf@HIDDEN>
 <ZUpvapul64hc0svD@ACM> <jwv5y2d31u6.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv5y2d31u6.fsf-monnier+emacs@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 66991
Cc: Eli Zaretskii <eliz@HIDDEN>, 66991 <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: -1.0 (-)

Hello, Stefan.

On Tue, Nov 07, 2023 at 12:38:34 -0500, Stefan Monnier wrote:
> > I get a failure in /test/src/comp-tests.log in test
> > comp-tests-interactive-form, where the test is expecting

> >     (interactive)

> > but the result of running the test innards is

> >     (interactive nil)

> I'd argue the test should accept either form.

> > ..  I don't understand why I'm only seeing this test failure now.

> Indeed, it's odd.

> > Maybe it's a new test.

> `git log test/lisp/emacs-lisp/comp-tests.el` suggests there's been no
> activity there of late.

> > OK.  :-)  But I think fixing data.c will be easier and cleaner than
> > fixing all the tests which might test it.

> I wouldn't call it a fix because I don't think the current behavior is
> broken, but I see no problem with `interactive-form` replacing
> `(interactive)` for `(interactive nil)` when it can do so cheaply.
> It may break other (broken) tests, of course.

What about replacing (interactive "") with (interactive) too, and
documenting this?

The doc string says that "Return the interactive form of CMD, or nil
....".  But you seem to be arguing that there is no unique _THE_
interactive form.  Just three possibilities for _AN_ interactive form.
The doc string doesn't make this clear, and needs amending anyway.

To fix only the doc string rather than the code too, would double the doc
string's size.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 66991) by debbugs.gnu.org; 7 Nov 2023 17:39:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 07 12:39:21 2023
Received: from localhost ([127.0.0.1]:43246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0Q2q-00088v-U7
	for submit <at> debbugs.gnu.org; Tue, 07 Nov 2023 12:39:21 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1r0Q2p-00088j-UB
 for 66991 <at> debbugs.gnu.org; Tue, 07 Nov 2023 12:39:20 -0500
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 73B41100068;
 Tue,  7 Nov 2023 12:38:36 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699378715;
 bh=I9YeG85aDn4vEv95ushI+2NLDCHaFXJ3ZkrybzBae0w=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=OewiGbdvn/s2SJHtMguLa3dyOBrsh9RtnU6j0oJH3pEMkUIoKD80VqA0YcNkC7Cmt
 qBeacIdUafAiG3jwuZqO7r/a9EPf+dT+3ykd2GdYddohKOzV/zpFdC5VdFnuRrNLJL
 T4FB3PhSmJZEJYEyOKf40tp+CMijP2cLw8Qao/O8JEpqPlmc+cPR9gH6r2pQzWSv3Z
 ST+nKsGwIjuAV70KlkU++QWsfvca/EeOJtpLh/AFdSfEdmNYOTKbDM6uWLvvzvbmTO
 6uWB8VMOV60a9/NjX3rNPfwbkJscEmy+kETaijQyhV0l3pFeCCJhqNbR11ukZbKtOB
 BZdt3k17tY7Hg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BD0CC100033;
 Tue,  7 Nov 2023 12:38:35 -0500 (EST)
Received: from pastel (unknown [45.72.212.125])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 91E76120313;
 Tue,  7 Nov 2023 12:38:35 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#66991: Confusion in interactive-form with commands with
 bare interactive forms.
In-Reply-To: <ZUpvapul64hc0svD@ACM> (Alan Mackenzie's message of "Tue, 7 Nov
 2023 17:10:02 +0000")
Message-ID: <jwv5y2d31u6.fsf-monnier+emacs@HIDDEN>
References: <ZUpoGwHli-EqtLk8@ACM> <83wmut1pb1.fsf@HIDDEN>
 <ZUpvapul64hc0svD@ACM>
Date: Tue, 07 Nov 2023 12:38:34 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.138 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66991
Cc: Eli Zaretskii <eliz@HIDDEN>, 66991 <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 (---)

> I get a failure in /test/src/comp-tests.log in test
> comp-tests-interactive-form, where the test is expecting
>
>     (interactive)
>
> but the result of running the test innards is
>
>     (interactive nil)

I'd argue the test should accept either form.

> ..  I don't understand why I'm only seeing this test failure now.

Indeed, it's odd.

> Maybe it's a new test.

`git log test/lisp/emacs-lisp/comp-tests.el` suggests there's been no
activity there of late.

> OK.  :-)  But I think fixing data.c will be easier and cleaner than
> fixing all the tests which might test it.

I wouldn't call it a fix because I don't think the current behavior is
broken, but I see no problem with `interactive-form` replacing
`(interactive)` for `(interactive nil)` when it can do so cheaply.
It may break other (broken) tests, of course.


        Stefan





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

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


Received: (at 66991) by debbugs.gnu.org; 7 Nov 2023 17:33:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 07 12:33:00 2023
Received: from localhost ([127.0.0.1]:43241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0Pwi-000806-2C
	for submit <at> debbugs.gnu.org; Tue, 07 Nov 2023 12:33:00 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33883)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1r0Pwg-0007zs-1s
 for 66991 <at> debbugs.gnu.org; Tue, 07 Nov 2023 12:32:58 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 94150807BC;
 Tue,  7 Nov 2023 12:32:14 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1699378333;
 bh=SJmHpl8vlTmOGmkgbCDs3kIVwPqDMt5+ZeK+70c/pOc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=KUETtGKrKClGKJK2Uwf6OZdreK/4fcxd20E/BGq3e0n8EZQmqAkyAkdSUd7rw+UCZ
 PwdBK3dgxQE6vZg8+cqmnkMPxdZPJTNS8+0MY/cqJuV1d9H027S0g0IfO8CUvaa8fc
 PogDtjMEIu/BWsyw8upbuyyLSubCrmJ0FCxgA1Z3K0iZcHYVnSYIzsloYneBZNxZuL
 0Bp7YAQav3fPS2Ig65wDkI8SAt2eyepn4DGC/quhPnjCOc47IPAvk+V+CsDHCTgD49
 MxQhsvnz4KKgh4YSQj553kbHufaEHT+oRG8Bc0LlrleAOGJPjYhf1lXv0n76dysIeU
 nMnGxSr/GOb/A==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C104B80506;
 Tue,  7 Nov 2023 12:32:13 -0500 (EST)
Received: from pastel (unknown [45.72.212.125])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 97B491203D6;
 Tue,  7 Nov 2023 12:32:13 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#66991: Confusion in interactive-form with commands with
 bare interactive forms.
In-Reply-To: <83wmut1pb1.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 07 Nov
 2023 18:49:38 +0200")
Message-ID: <jwvbkc532wm.fsf-monnier+emacs@HIDDEN>
References: <ZUpoGwHli-EqtLk8@ACM> <83wmut1pb1.fsf@HIDDEN>
Date: Tue, 07 Nov 2023 12:32:12 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.017 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66991
Cc: Alan Mackenzie <acm@HIDDEN>, 66991 <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 (---)

>> (interactive-form 'x-print-frames-dialog) => (interactive "") # a primitive
>> 
>> (interactive-form 'universal-argument) => (interactive nil) # a native
>>                                                       compiled command.

Both seem acceptable: the form can be either a string interpreted
internally by `call-interactively` or an expression whose value will
be the list of arguments.  It so happens that the interpretation of ""
results in an empty list of args, just like nil.  There might be
commands out there which use alternative ways to express such an empty
list, such as

    (interactive 'nil)

[ Presumably as a result of macro expansion of something like
  ...(interactive ',args)... ]

or

    (interactive (< 4 3))

[ Presumably the result of a prank or some such :-)  ]

Where/why do you need the representation to be more ... canonical?

>> The result is the same from a byte compiled command.
>>
>> Write (defun foo () (interactive)) in *scratch*, and C-M-x to evaluate
>> it:
>> (interactive-form 'foo) => (interactive).

For non-compiled functions, we just use `assq` on the body.
It's arguably not 100% correct, but it gets the job done cheaply.
It usually doesn't matter because `cadr` on this result is still nil.

>> That's three different inconsistent ways of expressing "(interactive".

Different, yes, but I don't see what's inconsistent about it, except
maybe for the fact that `interactive-form` can change from
`(interactive)` for an interpreted function to
`(interactive nil)` for the same function once it's byte-compiled, but
note that `(interactive EXP)` will generally change once byte-compiled
because EXP gets byte-compiled as well, so you generally can't presume
that `interactive-form` returns the exact same data-structure before and
after byte-compilation: the two should be "equivalent" but not
necessarily identical.


        Stefan





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

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


Received: (at 66991) by debbugs.gnu.org; 7 Nov 2023 17:10:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 07 12:10:49 2023
Received: from localhost ([127.0.0.1]:43207 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0PbF-0007QF-36
	for submit <at> debbugs.gnu.org; Tue, 07 Nov 2023 12:10:49 -0500
Received: from mail.muc.de ([193.149.48.3]:33553)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r0PbD-0007Pv-5Q
 for 66991 <at> debbugs.gnu.org; Tue, 07 Nov 2023 12:10:47 -0500
Received: (qmail 11173 invoked by uid 3782); 7 Nov 2023 18:10:02 +0100
Received: from acm.muc.de (p4fe15714.dip0.t-ipconnect.de [79.225.87.20])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 07 Nov 2023 18:10:02 +0100
Received: (qmail 17219 invoked by uid 1000); 7 Nov 2023 17:10:02 -0000
Date: Tue, 7 Nov 2023 17:10:02 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#66991: Confusion in interactive-form with commands with bare
 interactive forms.
Message-ID: <ZUpvapul64hc0svD@ACM>
References: <ZUpoGwHli-EqtLk8@ACM>
 <83wmut1pb1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83wmut1pb1.fsf@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 66991
Cc: acm@HIDDEN, 66991 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>
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: -1.0 (-)

Hello, Eli.

On Tue, Nov 07, 2023 at 18:49:38 +0200, Eli Zaretskii wrote:
> > Date: Tue, 7 Nov 2023 16:38:51 +0000
> > From: Alan Mackenzie <acm@HIDDEN>

> > Consider commands with no arguments, and do interactive-form on them:

> > (interactive-form 'x-print-frames-dialog) => (interactive "") # a primitive

> > (interactive-form 'universal-argument) => (interactive nil) # a native
> >                                                       compiled command.
> > The result is the same from a byte compiled command.

> > Write (defun foo () (interactive)) in *scratch*, and C-M-x to evaluate
> > it:
> > (interactive-form 'foo) => (interactive).

> > That's three different inconsistent ways of expressing "(interactive".
> > This is a bug.  For consistency's sake, two of them must be incorrect.

> Why?  Please explain in more positive terms why two out of three must
> be bugs, not just in some abstract philosophical terms.

I get a failure in /test/src/comp-tests.log in test
comp-tests-interactive-form, where the test is expecting

    (interactive)

but the result of running the test innards is

    (interactive nil)

..  I don't understand why I'm only seeing this test failure now.  Maybe
it's a new test.

Also, I think consistency in this sort of thing is a Good Thing.

> > I believe the correct one is the last of these, "(interactive)" which is
> > after all, what appears in the Lisp sources.  The fix should be
> > relatively simple, in Finteractive_form in src/data.c

> Please wait with implementing a fix until we discuss the issue and
> decide whether and how it should be fixed.

OK.  :-)  But I think fixing data.c will be easier and cleaner than
fixing all the tests which might test it.

> Adding Stefan to the discussion.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 66991) by debbugs.gnu.org; 7 Nov 2023 16:50:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 07 11:50:46 2023
Received: from localhost ([127.0.0.1]:43185 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0PHq-0006vq-FB
	for submit <at> debbugs.gnu.org; Tue, 07 Nov 2023 11:50:46 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:47394)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1r0PHo-0006ve-VJ
 for 66991 <at> debbugs.gnu.org; Tue, 07 Nov 2023 11:50:45 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1r0PH5-0003kC-Ud; Tue, 07 Nov 2023 11:49:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=LiYBFVLkUxwid8kqiyP1z35Hiq9MlV33ddS8yS1c3s0=; b=mURNWN7YkMy0
 xHpaKpjGQr2ZzRO7CQb7NJqM+1aV3tC+hdDdS6Uc77wRwQUiq/s+3/n4VT0dFZoGKgLvJ6E6ZqJgG
 BwJKOzeWCnyBAhoozi2MVAo0AlsqHfeopl2JnzBxugOY+XcYVFPBPQH/iv2GDZESBnVfUN52Uv8o8
 WesKN45WmA/K9fEdr5er8oGequ28X7UCdDv7mYAQa9OwReRopK7MFAzkVzb5RBuR35i3P2nME0dLJ
 Vl+6ba9UcagcSWFprQHY5btL1Qs3HiUEKTQCybOz6vVOb8u/ZanNN2mcrYEUV+wvHCu1nHZEvYum3
 Qm6Yw2JKJGykONnYcCuTpQ==;
Date: Tue, 07 Nov 2023 18:49:38 +0200
Message-Id: <83wmut1pb1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <ZUpoGwHli-EqtLk8@ACM> (message from Alan Mackenzie on Tue, 7 Nov
 2023 16:38:51 +0000)
Subject: Re: bug#66991: Confusion in interactive-form with commands with bare
 interactive forms.
References: <ZUpoGwHli-EqtLk8@ACM>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 66991
Cc: 66991 <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 (---)

> Date: Tue, 7 Nov 2023 16:38:51 +0000
> From: Alan Mackenzie <acm@HIDDEN>
> 
> Consider commands with no arguments, and do interactive-form on them:
> 
> (interactive-form 'x-print-frames-dialog) => (interactive "") # a primitive
> 
> (interactive-form 'universal-argument) => (interactive nil) # a native
>                                                       compiled command.
> The result is the same from a byte compiled command.
> 
> Write (defun foo () (interactive)) in *scratch*, and C-M-x to evaluate
> it:
> (interactive-form 'foo) => (interactive).
> 
> That's three different inconsistent ways of expressing "(interactive".
> This is a bug.  For consistency's sake, two of them must be incorrect.

Why?  Please explain in more positive terms why two out of three must
be bugs, not just in some abstract philosophical terms.

> I believe the correct one is the last of these, "(interactive)" which is
> after all, what appears in the Lisp sources.  The fix should be
> relatively simple, in Finteractive_form in src/data.c

Please wait with implementing a fix until we discuss the issue and
decide whether and how it should be fixed.

Adding Stefan to the discussion.




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

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


Received: (at submit) by debbugs.gnu.org; 7 Nov 2023 16:39:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 07 11:39:54 2023
Received: from localhost ([127.0.0.1]:43173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1r0P7K-0006ek-8G
	for submit <at> debbugs.gnu.org; Tue, 07 Nov 2023 11:39:54 -0500
Received: from lists.gnu.org ([2001:470:142::17]:57658)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1r0P7I-0006eU-GQ
 for submit <at> debbugs.gnu.org; Tue, 07 Nov 2023 11:39:52 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1r0P6b-0000K6-6P
 for bug-gnu-emacs@HIDDEN; Tue, 07 Nov 2023 11:39:09 -0500
Received: from mail.muc.de ([193.149.48.3])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <acm@HIDDEN>) id 1r0P6Z-0001dL-A1
 for bug-gnu-emacs@HIDDEN; Tue, 07 Nov 2023 11:39:08 -0500
Received: (qmail 75293 invoked by uid 3782); 7 Nov 2023 17:38:52 +0100
Received: from acm.muc.de (p4fe15714.dip0.t-ipconnect.de [79.225.87.20])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 07 Nov 2023 17:38:51 +0100
Received: (qmail 29294 invoked by uid 1000); 7 Nov 2023 16:38:51 -0000
Date: Tue, 7 Nov 2023 16:38:51 +0000
To: bug-gnu-emacs@HIDDEN
Subject: Confusion in interactive-form with commands with bare interactive
 forms.
Message-ID: <ZUpoGwHli-EqtLk8@ACM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@HIDDEN;
 helo=mail.muc.de
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
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: -0.1 (/)

Hello, Emacs

Consider commands with no arguments, and do interactive-form on them:

(interactive-form 'x-print-frames-dialog) => (interactive "") # a primitive

(interactive-form 'universal-argument) => (interactive nil) # a native
                                                      compiled command.
The result is the same from a byte compiled command.

Write (defun foo () (interactive)) in *scratch*, and C-M-x to evaluate
it:
(interactive-form 'foo) => (interactive).

That's three different inconsistent ways of expressing "(interactive".
This is a bug.  For consistency's sake, two of them must be incorrect.

I believe the correct one is the last of these, "(interactive)" which is
after all, what appears in the Lisp sources.  The fix should be
relatively simple, in Finteractive_form in src/data.c

-- 
Alan Mackenzie (Nuremberg, Germany).




Acknowledgement sent to Alan Mackenzie <acm@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#66991; 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: Wed, 8 Nov 2023 12:30:02 UTC

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