GNU bug report logs - #71934
31.0.50; edebug--called-interactively-skip vs. new fun objects

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: Michael Heerdegen <michael_heerdegen@HIDDEN>; Done: Stefan Monnier <monnier@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 71934-done <at> debbugs.gnu.org:


Received: (at 71934-done) by debbugs.gnu.org; 10 Jul 2024 11:28:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 10 07:28:21 2024
Received: from localhost ([127.0.0.1]:55009 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRVUi-0004Yl-K2
	for submit <at> debbugs.gnu.org; Wed, 10 Jul 2024 07:28:20 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53566)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sRVUf-0004YW-UR
 for 71934-done <at> debbugs.gnu.org; Wed, 10 Jul 2024 07:28:18 -0400
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 <acorallo@HIDDEN>)
 id 1sRVUT-0006b9-1w; Wed, 10 Jul 2024 07:28:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=O4D5H10vHXqi7Z+eIJxS6firDT8UlPhfpItabtVwUds=; b=RiUa63loPJtmvNsZSYuv
 Ly7wUetjJhgzwXfV4GJAKZfekzn6bU/u4WbVKbg+LhXg1f7C13dhByL3q12bYWkJggW5DyiF7uaWn
 En+JLF77sziAK/7xCI3H+F3jrVrTyxwudwuL9G3Cy06cc0lBzvJwRBSIEKczv9kmo0itGvJLORL6Z
 vkety0FnwajbFrENl30cakDk3Fa0y1Dnj3JAUT4hujnqIHrazcXvxFzCYNV8xeZnaMaWLOfWFAp8B
 EyH2WxzQJ2v813i8xNNUFP8wd8vrHO8Z1NBI7AMb/1X7eBAXSpqYPyCJf48ZFmdzTmTc4YmPysZ8c
 L0/Myp4oTSmRPQ==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sRVUR-0004Hh-2w; Wed, 10 Jul 2024 07:28:03 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#71934: comp--spill-lap-function and closure (wad:
 bug#71934: 31.0.50; edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <Zo5inccW-yss0OAy@ACM> (Alan Mackenzie's message of "Wed, 10 Jul
 2024 10:29:49 +0000")
References: <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <yp1le2fgdul.fsf@HIDDEN> <ZokkDv-tWbLuIFDh@ACM>
 <yp1cynqh1k2.fsf@HIDDEN>
 <yp1o776e1ex.fsf@HIDDEN> <Zo5inccW-yss0OAy@ACM>
Date: Wed, 10 Jul 2024 07:28:03 -0400
Message-ID: <yp1bk35ebb0.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934-done
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 71934-done <at> debbugs.gnu.org,
 Eli Zaretskii <eliz@HIDDEN>, 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: -3.3 (---)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Andrea.
>
> On Tue, Jul 09, 2024 at 16:49:26 -0400, Andrea Corallo wrote:
>> Andrea Corallo <acorallo@HIDDEN> writes:
>
>> > Alan Mackenzie <acm@HIDDEN> writes:
>
>> >> On Sat, Jul 06, 2024 at 03:48:50 -0400, Andrea Corallo wrote:
>> >>> Alan Mackenzie <acm@HIDDEN> writes:
>
> [ .... ]
>
>> > Thanks I see now, at least we never regressed over releases.
>
>> > I think this functionaly passed under my radar at the time, otherwise I
>> > would have asked for a test covering it, and BTW as a consequence Stefan
>> > would have updated the implementation before upstreaming his patch :)
>
> Yes.  ;-)
>
>> > Anyway as
>> > (defconst foo (lambda (baz) (car baz)))
>> > (byte-compile foo)
>> > works, I is nice to have it functional for native-comp as well.
>
>> > Reintroducing it should not be too difficult, I can do it myself next
>> > week if no-one does it before.
>
>> Okay should be done with b9b9322a8e6 in master adding a test and
>> updating 'native-compile' doc-string.
>
> Thanks.  I haven't actually tried the fix, but it looks absolutely
> routine, so there shouldn't be problems with it.
>
>> Is there anything left to do for this bug?
>
> I don't think so.

Okay cool, I think the bug is already closed.

Thanks

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 10 Jul 2024 10:30:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 10 06:30:06 2024
Received: from localhost ([127.0.0.1]:54952 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRUaM-0000D5-EB
	for submit <at> debbugs.gnu.org; Wed, 10 Jul 2024 06:30:06 -0400
Received: from mail.muc.de ([193.149.48.3]:53032)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sRUaK-0000C5-Hb
 for 71934 <at> debbugs.gnu.org; Wed, 10 Jul 2024 06:30:05 -0400
Received: (qmail 16124 invoked by uid 3782); 10 Jul 2024 12:29:52 +0200
Received: from muc.de (pd953a6f9.dip0.t-ipconnect.de [217.83.166.249]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 10 Jul 2024 12:29:50 +0200
Received: (qmail 8632 invoked by uid 1000); 10 Jul 2024 10:29:49 -0000
Date: Wed, 10 Jul 2024 10:29:49 +0000
To: Andrea Corallo <acorallo@HIDDEN>
Subject: Re: bug#71934: comp--spill-lap-function and closure (wad: bug#71934:
 31.0.50; edebug--called-interactively-skip vs. new fun objects)
Message-ID: <Zo5inccW-yss0OAy@ACM>
References: <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <yp1le2fgdul.fsf@HIDDEN> <ZokkDv-tWbLuIFDh@ACM>
 <yp1cynqh1k2.fsf@HIDDEN>
 <yp1o776e1ex.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <yp1o776e1ex.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: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, acm@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 71934 <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, Andrea.

On Tue, Jul 09, 2024 at 16:49:26 -0400, Andrea Corallo wrote:
> Andrea Corallo <acorallo@HIDDEN> writes:

> > Alan Mackenzie <acm@HIDDEN> writes:

> >> On Sat, Jul 06, 2024 at 03:48:50 -0400, Andrea Corallo wrote:
> >>> Alan Mackenzie <acm@HIDDEN> writes:

[ .... ]

> > Thanks I see now, at least we never regressed over releases.

> > I think this functionaly passed under my radar at the time, otherwise I
> > would have asked for a test covering it, and BTW as a consequence Stefan
> > would have updated the implementation before upstreaming his patch :)

Yes.  ;-)

> > Anyway as
> > (defconst foo (lambda (baz) (car baz)))
> > (byte-compile foo)
> > works, I is nice to have it functional for native-comp as well.

> > Reintroducing it should not be too difficult, I can do it myself next
> > week if no-one does it before.

> Okay should be done with b9b9322a8e6 in master adding a test and
> updating 'native-compile' doc-string.

Thanks.  I haven't actually tried the fix, but it looks absolutely
routine, so there shouldn't be problems with it.

> Is there anything left to do for this bug?

I don't think so.

>   Andrea

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 71934) by debbugs.gnu.org; 9 Jul 2024 20:51:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 09 16:51:53 2024
Received: from localhost ([127.0.0.1]:54225 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRHoX-0006Cm-0q
	for submit <at> debbugs.gnu.org; Tue, 09 Jul 2024 16:51:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36222)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sRHoV-0006CZ-Fz
 for 71934 <at> debbugs.gnu.org; Tue, 09 Jul 2024 16:51:52 -0400
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 <acorallo@HIDDEN>)
 id 1sRHmB-0003oU-UI; Tue, 09 Jul 2024 16:49:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=Py/HQEiGFDQ9qDqlFVb0yaf8KejW6XJaa71W7lc1ccE=; b=AgEnb4fy7dqlOMeTcY9K
 jWNhOXECGzvZ+MhiT56HwGmnrSpyszsBD06hnEvPOWVomhiWo041MtcNxVMtiJrdWx5VrI4QjVzmh
 qDWvQhGJkzI9a70GjWkj2ZIyQf5ooc/V5xkpggCxRbe+hXx6eWAL6VjTBx0fyOeku4BC3yvSh6wvm
 mBDS/lHl4IocI24lJeOUNzAC5Ye6BK3L1I4j1Sc2UUFXntKTqkjQf40PvKeFV/7ZHyGLoCCbhF55L
 K3T175c8dpN+KSYZXZOdgdtDqOXukGVYRy2QbCmKxK0uOow6snN1rSKlBELhG567OQtlWWwfiO40K
 8Usf+xefShlyHg==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sRHmA-0002rP-U3; Tue, 09 Jul 2024 16:49:27 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#71934: comp--spill-lap-function and closure (wad:
 bug#71934: 31.0.50; edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <yp1cynqh1k2.fsf@HIDDEN> (Andrea Corallo's message of
 "Sat, 06 Jul 2024 13:29:01 -0400")
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <yp1le2fgdul.fsf@HIDDEN> <ZokkDv-tWbLuIFDh@ACM>
 <yp1cynqh1k2.fsf@HIDDEN>
Date: Tue, 09 Jul 2024 16:49:26 -0400
Message-ID: <yp1o776e1ex.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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 (---)

Andrea Corallo <acorallo@HIDDEN> writes:

> Alan Mackenzie <acm@HIDDEN> writes:
>
>> Hello, Andrea.
>>
>> On Sat, Jul 06, 2024 at 03:48:50 -0400, Andrea Corallo wrote:
>>> Alan Mackenzie <acm@HIDDEN> writes:
>>
>>> > Hello, Stefan.
>>
>>> > On Fri, Jul 05, 2024 at 14:17:38 -0400, Stefan Monnier wrote:
>>> >> > Not sure what you mean by "no such thing as a form ... like a closure".
>>
>>> >> A form that starts with `closure` is not a valid form because there is
>>> >> no definition for `closure`: (fboundp 'closure) => nil.
>>
>>> >> > I bumped into one last summer.
>>
>>> >> > In particular (in my development repo fixing bug #64646) I put this into
>>> >> > *scratch*:
>>
>>> >> >     (defconst foo (lambda (baz) (car baz)))
>>
>>> >> > , evaluated it with C-x C-e and then M-: (native-compile foo).  This
>>> >> > threw the error "Cannot native-compile, form is not a lambda".
>>
>>> >> That error seems right according to the docstring:
>>
>>> >>    (defun native-compile (function-or-file &optional output)
>>> >>      "Compile FUNCTION-OR-FILE into native code.
>>> >>    This is the synchronous entry-point for the Emacs Lisp native
>>> >>    compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
>>> >>    filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
>>> >>    it as the filename for the compiled object.  If FUNCTION-OR-FILE
>>> >>    is a filename, if the compilation was successful return the
>>> >>    filename of the compiled object.  If FUNCTION-OR-FILE is a
>>> >>    function symbol or a form, if the compilation was successful
>>> >>    return the compiled function."
>>
>>> >> (closure ...) is not a function symbol nor a valid form.  Instead it's
>>> >> a function value and the docstring doesn't say such are
>>> >> a valid arguments to `native-compile`.
>>
>>> > All very clever arguments, no doubt, but in the end it means you cannot
>>> > native compile foo.  I've just tried it on emacs-30, and it doesn't work.
>>> > But you could compile foo last summer after my fixes for bug #64646.
>>> > Between last summer and now, something has gone badly wrong in Emacs's
>>> > basic mechanisms.
>>
>>> (defconst foo (lambda (baz) (car baz)))
>>> (native-compile #'foo)
>>
>>> Never worked AFAIR, ....
>>
>> No.  But (native-compile foo) did work.  It compiled the value of foo,
>> producing an anonymous subr.
>>
>>> ....the functionality you added was:
>>
>>> (defun foo () "foo doc string"
>>>        (lambda () "lambda doc string" 3))
>>
>>> (subr-native-elisp-p (funcall (native-compile 'foo)))
>>
>> Yes.
>>
>>> And this still works for me.
>>
>> It still works for me, too.
>>
>>> I'm probably missing something sorry.
>>
>> The fact that
>>
>> 	(defconst foo (lambda (baz) (car baz)))
>> 	(native-compile foo)
>>
>> worked (as of 2023-11-08), but no longer does.  It was not the main topic
>> of bug #64646 (for which see above), but was fixed in the commit for that
>> bug anyway.  This was possibly not a good idea.  That commit was:
>>
>> commit 06e4ebc81a44c709b08ce72c746629c6c77e6f6e
>> Author: Alan Mackenzie <acm@HIDDEN>
>> Date:   Wed Nov 8 20:49:48 2023 +0000
>>
>>     With `native-compile', compile lambdas in a defun or lambda too
>
> Thanks I see now, at least we never regressed over releases.
>
> I think this functionaly passed under my radar at the time, otherwise I
> would have asked for a test covering it, and BTW as a consequence Stefan
> would have updated the implementation before upstreaming his patch :)
>
> Anyway as
> (defconst foo (lambda (baz) (car baz)))
> (byte-compile foo)
> works, I is nice to have it functional for native-comp as well.
>
> Reintroducing it should not be too difficult, I can do it myself next
> week if no-one does it before.

Okay should be done with b9b9322a8e6 in master adding a test and
updating 'native-compile' doc-string.

Is there anything left to do for this bug?

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 9 Jul 2024 05:19:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 09 01:19:02 2024
Received: from localhost ([127.0.0.1]:51903 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sR3Fl-00074x-QW
	for submit <at> debbugs.gnu.org; Tue, 09 Jul 2024 01:19:02 -0400
Received: from mout.web.de ([212.227.15.3]:54773)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sR3Fi-00074T-Qh
 for 71934 <at> debbugs.gnu.org; Tue, 09 Jul 2024 01:19:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1720502313; x=1721107113;
 i=michael_heerdegen@HIDDEN;
 bh=mtD1goZmmnHvJ0QfNsVGI9CldRBtto/m3BMsMA4Vxnk=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=clVQgar3/m3dDMBZLfmRiQR7ZPRgdOEU6aR92NM2F7uPBqQVg1ESq8G1CRF+VpIu
 v9YgIWGDQC/qLFsg+/ER1FrMWJShrh9ATJKBcKDZymv8M4ti4dP7qvdw4NXHCeQAj
 t53UkbvEjFHyJDOGduFtXugsqA0XWcqGrGrbe5kp/gqY86G2rzwTWuhN9d4jwfHkd
 k0tT9Uhm0/Lii31DiqbrpE6aDhF09rgPKXDM5V8eBXOMs5FhSjxeCyKVK8o21xeG7
 M+3UYOIYO0J8yjROotQLgDXZrSVEq+4vh+m6xf+r8ln2wUM5k0bIkFh2lX3Gw9y3R
 qy5g+6gNKQTj8XmVzA==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.113]) by smtp.web.de (mrweb005
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N8Vsr-1sMm2C07v7-00y9QM; Tue, 09
 Jul 2024 07:18:33 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <Zou9C2qddCW4npN5@ACM> (Alan Mackenzie's message of "Mon, 8 Jul
 2024 10:18:51 +0000")
References: <Zof2edaqLQfHD4_B@ACM> <jwvbk3b970b.fsf-monnier+emacs@HIDDEN>
 <Zogj1XE39AgJom0Z@ACM> <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN>
 <ZohPp8z4PgCCrbqX@ACM> <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN>
 <ZohohZGpcOPTJwKR@ACM> <87bk3b8h2n.fsf@HIDDEN> <ZolUNrh_Y-aOtzXc@ACM>
 <871q44br8r.fsf@HIDDEN> <Zou9C2qddCW4npN5@ACM>
Date: Tue, 09 Jul 2024 07:19:21 +0200
Message-ID: <87v81ff8h2.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:X3UpQN8Yhsqey7gctWEyNQEX1l7WIt0leDDh6gZeHbiRvxImAGV
 1+pTkR55Gda1hTfQW2dCssyG3LSefUaYzr8B4HOIe6B7Q08MJEUa8LODWN7tNraCZLKhM65
 l6r860K0N43D3YPkhMj48c2LaQXLgQUgWymPFvEmE6O8SJOmgufMZMn7P70cOwT2cyJBR54
 rlyDUNXyji4NWUDi7G25g==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:zinm63uj6Dc=;ila0EdsyJ1OlKKApedPziFnl1MV
 JYweomXTEg0FEhhlSlL+BHTZyg2GeFNnKiF6j12SlLRVG0k44lvA2IuH9suyVXsj9gr99Q6Ki
 OCBqQMscmvQIng/cvkjVOeV74pTZi5r7P61ujghJKSAoNRbPwLlSWWIkozznVnHzwi+cgowft
 QA4TTAYeo3khL1vjVze3m81bY34VlqnCgDTcmoZ99XkqpZ2jsPwoLlPSOgKrrWrz9h9pcGp4A
 dR3R5ds3ZpaVacN1rwVEp4S1Bs+4nIf9kalws7Xq7sNCadM56HPyAZ7w5Kns2l0nvK9zoGpNJ
 lfBdqbDe0s6HSsvIhEDaX1NUKEvmzBhCnDBsp2NwtDchPxdcXvOLYvHhf7vEIp3YULzxvbANt
 u7xhA15wnp+I8zgE0wi//OXN1725Ei47s72l+f+6GQ6eXJd2pdETTz4tcYwzsb7xIq2+W260h
 h3SBGRAPsjiCTfDbSyoGCZhY3s8UYzX4I2tpff9Y3ij4hrwRrgO89Id6iwdoitbibjO9Fkhtf
 TsBLlg1/0cswZDltHFkm1MsBcWc+x9Y9mq9lgrlGx8BbgjRUEYIO0DjsoOuODweEaqLvaZFr/
 spwjfR04k5oVL+nl8oMV7uV44TG2xld0GlAtKC7V2XD8Om8PWRvHj1SUhhvy4RfeoVFBSvgAA
 M+gsyCX/RJRJkUlQrA6TkQmfUmoJvu89n4PXgmeQA93fuBDDRGUqsquvUQ9VWcyEoH5tslWFs
 XoPdGV8lhRcznT68Iy+h3C91JVPfdxr3P43o+aWU+UTAM8Hsypb43gEfaXiNWE5D+qCtqAjqW
 l1h7dUwkguxupCZZ4zJLZAN0ZevS8HMRSFi5O5bmEG730=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 71934
Cc: Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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.7 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> I'm not entirely sure what you mean by "function value".

A form is code, an expression, something that can be evaluated.

A value is the result of an evaluation.  A "function value" is a value
that can be funcalled.

The signature (cl-defmethod comp--spill-lap-function ((form list)) ...)
lets the reader think the argument is always a form.  This is why Stefan
missed this occurrence.  You made it handle function values as well.

Although in Lisp forms and values are both objects, or values so to say,
it makes sense to write code in a way that lets the reader see whether
arguments are expressions or not, because else everything soon gets
confusing, as we see here.

And I really have not to say anything about the matter.  I only wanted
to get the thing started.

Michael.




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

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


Received: (at 71934) by debbugs.gnu.org; 8 Jul 2024 10:19:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 08 06:19:06 2024
Received: from localhost ([127.0.0.1]:49780 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQlSc-0004Yw-8H
	for submit <at> debbugs.gnu.org; Mon, 08 Jul 2024 06:19:06 -0400
Received: from mail.muc.de ([193.149.48.3]:45973)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sQlSa-0004YS-2w
 for 71934 <at> debbugs.gnu.org; Mon, 08 Jul 2024 06:19:04 -0400
Received: (qmail 96374 invoked by uid 3782); 8 Jul 2024 12:18:52 +0200
Received: from muc.de (pd953a093.dip0.t-ipconnect.de [217.83.160.147]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Mon, 08 Jul 2024 12:18:52 +0200
Received: (qmail 5380 invoked by uid 1000); 8 Jul 2024 10:18:51 -0000
Date: Mon, 8 Jul 2024 10:18:51 +0000
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
Message-ID: <Zou9C2qddCW4npN5@ACM>
References: <Zof2edaqLQfHD4_B@ACM> <jwvbk3b970b.fsf-monnier+emacs@HIDDEN>
 <Zogj1XE39AgJom0Z@ACM> <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN>
 <ZohPp8z4PgCCrbqX@ACM> <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN>
 <ZohohZGpcOPTJwKR@ACM> <87bk3b8h2n.fsf@HIDDEN>
 <ZolUNrh_Y-aOtzXc@ACM> <871q44br8r.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <871q44br8r.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: 71934
Cc: acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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, Michael.

On Mon, Jul 08, 2024 at 03:35:16 +0200, Michael Heerdegen wrote:
> Alan Mackenzie <acm@HIDDEN> writes:

> > It's apparent that the one that used to work,

> >     (cl-defmethod comp--spill-lap-function ((form list))

> > , no longer works since function forms were converted to a different
> > format in March.  It needs modifying to handle the new format.

> That was the question.

> So, of what kind can the argument FORM be?  Any form (any lisp
> expression - any kind of "code") - lambda lists, function values?

I'm not entirely sure what you mean by "function value".  Before March,
that method handled lists whose car was either lambda or closure.  It
likely still does.

> As far as I understand the above method originally supported lambda
> lists and you made it handle function values as well.

I made it handle lists with a car of closure.

> And because function values are now represented differently the above
> method does not handle this case any more.

> Is this correct?

I think so, yes.  It would appear we need a new version of
comp--spill-lap-function to handle the new format of functions.

> Thx,

> Michael.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 71934) by debbugs.gnu.org; 8 Jul 2024 08:47:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 08 04:47:20 2024
Received: from localhost ([127.0.0.1]:49632 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQk1n-0007dB-L6
	for submit <at> debbugs.gnu.org; Mon, 08 Jul 2024 04:47:19 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sQk1l-0007cl-MZ
 for 71934 <at> debbugs.gnu.org; Mon, 08 Jul 2024 04:47:18 -0400
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 <acorallo@HIDDEN>)
 id 1sQk1a-0006K0-E1; Mon, 08 Jul 2024 04:47:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=XSKBfO3cEP0ZM2tFs+HCgpfGzXpiwr2toPzASgLOq+w=; b=AqYtkJBE/l1mi/4D8QaQ
 hGhdNVIkQWLyXdLwpZUJwWW6I4wpW1audtsRZr9ss3xM8pmNJc1PPAmWeLUJjvSdej3ZEPmOYg2cR
 45RqPsCd6xgg2XNWchwcQYSoKqGFhWk7HqzD3iRE9Z5gzzRkMaxQGXg325nP1mrSl3OT9A8khkUeq
 sPDGaQROQbKcLOO5abhsNCfjhUTXhgxVjcgrmBDyhGuw6bJ157aLFe7mygpVTTyTOe9OnlDUWvXn4
 efvwN4fjS6c91qkP/JK8mUIHx1YsU/gJQ92wx86HwV1JpWKZQSKCS7QK2f3mN547EHWQKmEkC13jI
 TDvJXpcVKS1k1g==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sQk1Z-0005Cw-Ss; Mon, 08 Jul 2024 04:47:05 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <jwvh6d062fk.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sun, 07 Jul 2024 22:32:43 -0400")
References: <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
 <87bk3b8h2n.fsf@HIDDEN> <ZolUNrh_Y-aOtzXc@ACM> <871q44br8r.fsf@HIDDEN>
 <jwvh6d062fk.fsf-monnier+emacs@HIDDEN>
Date: Mon, 08 Jul 2024 04:47:05 -0400
Message-ID: <yp1v81gfeye.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Alan Mackenzie <acm@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 71934 <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 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>>> It's apparent that the one that used to work,
>>>
>>>     (cl-defmethod comp--spill-lap-function ((form list))
>>>
>>> , no longer works since function forms were converted to a different
>>> format in March.  It needs modifying to handle the new format.
>>
>> That was the question.
>>
>> So, of what kind can the argument FORM be?  Any form (any lisp
>> expression - any kind of "code") - lambda lists, function values?
>>
>> As far as I understand the above method originally supported lambda
>> lists and you made it handle function values as well.  And because
>> function values are now represented differently the above method does
>> not handle this case any more.
>>
>> Is this correct?
>
> Yeah, I also fail to understand the relationship between
> `comp--spill-lap-function` (which sounds internal to the compilation
> pipeline and thus might apply to all sorts of subexpressions of the
> input code) and `native-compile` (where adding support for function
> values affects only the "toplevel" of the input).

'comp--spill-lap-function' serves 'comp--spill-lap' which is the first
pass of the native compilation pipeline.  So adding a new method there
is the usual way to make native-compile support new kind of inputs.

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 8 Jul 2024 02:32:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 07 22:32:57 2024
Received: from localhost ([127.0.0.1]:49373 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQeBV-0006By-00
	for submit <at> debbugs.gnu.org; Sun, 07 Jul 2024 22:32:57 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13983)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sQeBT-0006Bh-W8
 for 71934 <at> debbugs.gnu.org; Sun, 07 Jul 2024 22:32:56 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 64A74100043;
 Sun,  7 Jul 2024 22:32:45 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720405964;
 bh=N+YTiTSvdkf5pRNjxaVB4ZUHLV0jmgr7U2lXVj/xbRk=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=GK45arB6t4sb2C5lXjjZacp3RALwooxyvIMVa0kzkD6BiEYeELRH1Jug6jmsro2y7
 jtHMnX92Dlm7fyvbIFLCTMYhNmH0JddI4cXOH0LUc72TxhKhG8WqrAc7v/UHKAgPtj
 E8pZej8Lr+eTteNyNLTW6OjGtAGCwu+mdIfM/oDZf2Uk5RfenKpsZfyzwuzvKITL3l
 mZfXx+AMl3oC/DeAsUE9ZvtyK39i6bm5izJY4YsBx32YklC9R2kB08LEJ7O76iDhQL
 zkGvi/Z9BCBbQdBtWDOg6FeiwK3Af+1KnweMl1WwA1VRlj3Jorb3qCIvpGR76A1g8A
 UNIA6MpvHmQYQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 845D910002E;
 Sun,  7 Jul 2024 22:32:44 -0400 (EDT)
Received: from pastel (unknown [45.72.245.253])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4A2ED12037B;
 Sun,  7 Jul 2024 22:32:44 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <871q44br8r.fsf@HIDDEN> (Michael Heerdegen's message of "Mon, 08
 Jul 2024 03:35:16 +0200")
Message-ID: <jwvh6d062fk.fsf-monnier+emacs@HIDDEN>
References: <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
 <87bk3b8h2n.fsf@HIDDEN> <ZolUNrh_Y-aOtzXc@ACM> <871q44br8r.fsf@HIDDEN>
Date: Sun, 07 Jul 2024 22:32:43 -0400
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.004 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Alan Mackenzie <acm@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Andrea Corallo <acorallo@HIDDEN>, 71934 <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 (---)

>> It's apparent that the one that used to work,
>>
>>     (cl-defmethod comp--spill-lap-function ((form list))
>>
>> , no longer works since function forms were converted to a different
>> format in March.  It needs modifying to handle the new format.
>
> That was the question.
>
> So, of what kind can the argument FORM be?  Any form (any lisp
> expression - any kind of "code") - lambda lists, function values?
>
> As far as I understand the above method originally supported lambda
> lists and you made it handle function values as well.  And because
> function values are now represented differently the above method does
> not handle this case any more.
>
> Is this correct?

Yeah, I also fail to understand the relationship between
`comp--spill-lap-function` (which sounds internal to the compilation
pipeline and thus might apply to all sorts of subexpressions of the
input code) and `native-compile` (where adding support for function
values affects only the "toplevel" of the input).


        Stefan





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

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


Received: (at 71934) by debbugs.gnu.org; 8 Jul 2024 01:34:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 07 21:34:58 2024
Received: from localhost ([127.0.0.1]:49352 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQdHN-0004k7-R6
	for submit <at> debbugs.gnu.org; Sun, 07 Jul 2024 21:34:58 -0400
Received: from mout.web.de ([212.227.15.4]:55195)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sQdHL-0004jo-HY
 for 71934 <at> debbugs.gnu.org; Sun, 07 Jul 2024 21:34:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1720402465; x=1721007265;
 i=michael_heerdegen@HIDDEN;
 bh=MsdbgHI8Xzs3HH9/sOEWIqbZ5Bxxk8NNY0d3/1xp61I=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=hTq4ofoNN/XkHRJstxt99neb7RtjJp4ucX0+l+cwUo/GDCFfUj/44SZYXxnFocQR
 KAsMbC8s2PgrCbl1Vm3CDgrGyL2zUQyUPjiyIJksBn5cSyFtnSsHNK6aHyOE0/oxu
 ekAKbH4Mb105bVaVTUq7nqud9Uv3J8TGgIwoXC11DZPZ/BSsNoOxLK4UeFD0IO7B2
 ivzpkVT+p8CZuDdJHSAmakJQ7l7VU8NiMuEAZeW1UUUYXB3YAOAwTTXTmViZzIYK0
 xAP3dPkir0YgjPgr2iG9V7COysFiG5Wh1LnOziEMD5ditRBvuAHzPbOOjvyomQvdo
 f9oRUOEKdtjNY6i4fg==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.113]) by smtp.web.de (mrweb006
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MgRMB-1ru4oY06Mp-00nhk2; Mon, 08
 Jul 2024 03:34:25 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <ZolUNrh_Y-aOtzXc@ACM> (Alan Mackenzie's message of "Sat, 6 Jul
 2024 14:27:02 +0000")
References: <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
 <87bk3b8h2n.fsf@HIDDEN> <ZolUNrh_Y-aOtzXc@ACM>
Date: Mon, 08 Jul 2024 03:35:16 +0200
Message-ID: <871q44br8r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:JBc8zGccJ/Bh7JvDfGOlGGedup4uxo6dO9VPwUwYlpQQ7p2VLoM
 BoctXiMBbTFRmIKtv3PxeCcAwMLVA9XksCEQOrKAr8yo1Mo70I6Jhs5rvc765vRg5ZIQKe9
 aBIKhm3wxjZ4koS9qIWtZuiaMzqMAmruPTRGHtI2aNOJRNeVEy6kUgzCKbqxdWyajTRBS1/
 yFWYG5neNZZTsWVHQbXPw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:mFrebTKm364=;f+ohPhkqpHc+eHKhsTQ9UifyqTM
 4MofMXNlgcxThSZQhYnQigzYufCbLDqzSUrPyLjC5Q7Cz8KJs2g7ZPQQFJP49AxvIBUZND1M2
 6DBa0ucKah3W6WftfNWrG5Z4FTR93410TnEctCSTft8jDssXmoFUZWbBfJBaffyx9GzmbqRjP
 W1NVwTwFh6A/tqEZdpVPE8AwmlJ7bUZZz/EqNYPu4mfjIq9xDnO95s8+RS1UwRyPzIy3V1N4D
 l2ie2DEfd/jW+TdVD7453NUpgpGBoouEZZQIiJHhzJ4erZUcn5OpT4Cxyfk9ZYhTkLP7VshSB
 SYB8PQXnACW1XCQULT+UXlSDb1XJM4j3HQyk0jW17/ahriLGqh1xlUMtsDCrJHFNNyXLWHKxR
 7M5hUs3IGHxbGjUCGKAfBg3jDWAvia6J/fah3055VKnMXC4LlTVgVP2DompLUqNU1Ag5Weww7
 Th1BPOzNmxkHUt7/Bhyx5QABqVjUGxDE7X8m2oav7R5TWM6z0mOsQeQ8gXdKheZICCYvZ5KJ3
 qk+Ns8EoyzQchiQOnQo5Kblb+bwWf1O0PRy2gJ8wy2rDuA0KBLCeEC66k9XK3vk7wKqKJS51v
 OGpH4PHM3T5YQSCmR0N02hs7vi0ec356zDIufdhZ0sQm7lbrszqyoKVW+4n8i6VzlwCQr4Wg1
 fLI1LGY8KQZ3wkuMSskXptppjOKQNMUiFXLDD/dwMSGqwJwEJEi3yGCvywTKbnpk+ZzEmqQ7C
 O2pdxEIvDcH4GXeWaESv4RdoVdEQGcLHtR3q4R4OZbQQt+JENj94S5mtqmlUUlhM10Jeg0Td3
 Q+l9bip9wBK6cqvPQRlz/BBa+CKpCqwkFUwH05wNxE5jM=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 71934
Cc: Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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.7 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> It's apparent that the one that used to work,
>
>     (cl-defmethod comp--spill-lap-function ((form list))
>
> , no longer works since function forms were converted to a different
> format in March.  It needs modifying to handle the new format.

That was the question.

So, of what kind can the argument FORM be?  Any form (any lisp
expression - any kind of "code") - lambda lists, function values?

As far as I understand the above method originally supported lambda
lists and you made it handle function values as well.  And because
function values are now represented differently the above method does
not handle this case any more.

Is this correct?


Thx,

Michael.




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 17:29:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 13:29:16 2024
Received: from localhost ([127.0.0.1]:46719 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQ9Do-0007IX-0f
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 13:29:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:34192)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sQ9Dl-0007II-JK
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 13:29:14 -0400
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 <acorallo@HIDDEN>)
 id 1sQ9Dc-00070O-FH; Sat, 06 Jul 2024 13:29:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=P+HFc0l9Ywv4ko3itUXpVCV9shdVzi9Up3I5RoBnjAg=; b=qHDJ9XKD5HeV6mradfEQ
 MhynS6exqTtUE9NmdjfdPcg6ln0l86IzkL2aG4wxY2888pUtx7olH/8oc3HC4CNBXaPDIlF55dVq5
 OrefRdQWCCeAd0FTDJ8ao09+POWoHdhLdzisAhOEukEfcNkqhClE6+m3he9HNDsDj96+d+7xwOADd
 mEjJzhu6kLBiK0KOyAkSLllUHFegFun11OghM/sDBf3oZFHZg0feAeJ21jSrhwquETbIk+Z6zD4nk
 ECnrJ7623UGAkYAfJlgwXyep2KLfoSSlEy8Gfhs03+gYUUS1/LfU+jbi+hdCwQKYnoXLpT0AMhPMt
 hdTbuaQjb4pb/Q==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sQ9Da-0005yj-12; Sat, 06 Jul 2024 13:29:02 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <ZokkDv-tWbLuIFDh@ACM> (Alan Mackenzie's message of "Sat, 6 Jul
 2024 11:01:34 +0000")
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <yp1le2fgdul.fsf@HIDDEN> <ZokkDv-tWbLuIFDh@ACM>
Date: Sat, 06 Jul 2024 13:29:01 -0400
Message-ID: <yp1cynqh1k2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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 (---)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Andrea.
>
> On Sat, Jul 06, 2024 at 03:48:50 -0400, Andrea Corallo wrote:
>> Alan Mackenzie <acm@HIDDEN> writes:
>
>> > Hello, Stefan.
>
>> > On Fri, Jul 05, 2024 at 14:17:38 -0400, Stefan Monnier wrote:
>> >> > Not sure what you mean by "no such thing as a form ... like a closure".
>
>> >> A form that starts with `closure` is not a valid form because there is
>> >> no definition for `closure`: (fboundp 'closure) => nil.
>
>> >> > I bumped into one last summer.
>
>> >> > In particular (in my development repo fixing bug #64646) I put this into
>> >> > *scratch*:
>
>> >> >     (defconst foo (lambda (baz) (car baz)))
>
>> >> > , evaluated it with C-x C-e and then M-: (native-compile foo).  This
>> >> > threw the error "Cannot native-compile, form is not a lambda".
>
>> >> That error seems right according to the docstring:
>
>> >>    (defun native-compile (function-or-file &optional output)
>> >>      "Compile FUNCTION-OR-FILE into native code.
>> >>    This is the synchronous entry-point for the Emacs Lisp native
>> >>    compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
>> >>    filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
>> >>    it as the filename for the compiled object.  If FUNCTION-OR-FILE
>> >>    is a filename, if the compilation was successful return the
>> >>    filename of the compiled object.  If FUNCTION-OR-FILE is a
>> >>    function symbol or a form, if the compilation was successful
>> >>    return the compiled function."
>
>> >> (closure ...) is not a function symbol nor a valid form.  Instead it's
>> >> a function value and the docstring doesn't say such are
>> >> a valid arguments to `native-compile`.
>
>> > All very clever arguments, no doubt, but in the end it means you cannot
>> > native compile foo.  I've just tried it on emacs-30, and it doesn't work.
>> > But you could compile foo last summer after my fixes for bug #64646.
>> > Between last summer and now, something has gone badly wrong in Emacs's
>> > basic mechanisms.
>
>> (defconst foo (lambda (baz) (car baz)))
>> (native-compile #'foo)
>
>> Never worked AFAIR, ....
>
> No.  But (native-compile foo) did work.  It compiled the value of foo,
> producing an anonymous subr.
>
>> ....the functionality you added was:
>
>> (defun foo () "foo doc string"
>>        (lambda () "lambda doc string" 3))
>
>> (subr-native-elisp-p (funcall (native-compile 'foo)))
>
> Yes.
>
>> And this still works for me.
>
> It still works for me, too.
>
>> I'm probably missing something sorry.
>
> The fact that
>
> 	(defconst foo (lambda (baz) (car baz)))
> 	(native-compile foo)
>
> worked (as of 2023-11-08), but no longer does.  It was not the main topic
> of bug #64646 (for which see above), but was fixed in the commit for that
> bug anyway.  This was possibly not a good idea.  That commit was:
>
> commit 06e4ebc81a44c709b08ce72c746629c6c77e6f6e
> Author: Alan Mackenzie <acm@HIDDEN>
> Date:   Wed Nov 8 20:49:48 2023 +0000
>
>     With `native-compile', compile lambdas in a defun or lambda too

Thanks I see now, at least we never regressed over releases.

I think this functionaly passed under my radar at the time, otherwise I
would have asked for a test covering it, and BTW as a consequence Stefan
would have updated the implementation before upstreaming his patch :)

Anyway as
(defconst foo (lambda (baz) (car baz)))
(byte-compile foo)
works, I is nice to have it functional for native-comp as well.

Reintroducing it should not be too difficult, I can do it myself next
week if no-one does it before.

Thanks

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 14:27:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 10:27:15 2024
Received: from localhost ([127.0.0.1]:46528 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQ6Nf-0002UX-2I
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 10:27:15 -0400
Received: from mail.muc.de ([193.149.48.3]:13709)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sQ6Nc-0002UI-Dg
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 10:27:13 -0400
Received: (qmail 8350 invoked by uid 3782); 6 Jul 2024 16:27:03 +0200
Received: from muc.de (p4fe15482.dip0.t-ipconnect.de [79.225.84.130]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 06 Jul 2024 16:27:02 +0200
Received: (qmail 2991 invoked by uid 1000); 6 Jul 2024 14:27:02 -0000
Date: Sat, 6 Jul 2024 14:27:02 +0000
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
Message-ID: <ZolUNrh_Y-aOtzXc@ACM>
References: <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
 <87bk3b8h2n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87bk3b8h2n.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: 71934
Cc: acm@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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, Michael.

On Sat, Jul 06, 2024 at 03:06:24 +0200, Michael Heerdegen wrote:
> Alan Mackenzie <acm@HIDDEN> writes:

> > > > All very clever arguments, no doubt, but in the end it means you
> > > > cannot native compile foo.

> > > To obey the docstring, ....

> > Forget that doc string, just do what is right, expected, and convenient
> > for Emacs users, and adjust the doc string afterwards.

> We are actually trying to do that, but we don't understand the code
> because of the lacking or wrong documentation.

Would that code be comp--spill-lap-function, perhaps?  There are
currently three functions with that name, each for a different type of
argument.

It's apparent that the one that used to work,

    (cl-defmethod comp--spill-lap-function ((form list))                                                                   

, no longer works since function forms were converted to a different
format in March.  It needs modifying to handle the new format.

> Maybe we already had introduced a regression because of that.  And now
> three people try to guess what the code does.  Our time is also
> valuable, Alan.  This documentation is important.

I don't really see where the problem is: comp--spill-lap-function, all
versions, isolates the Lisp source form, passes it to the byte compiler
and receives the intermediate compiled form in the hash table
byte-to-native-lambdas-h.  This intermediate form is then fed to the
native compilation engine.

Or am I not understanding what you're asking?

> Michael.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 11:01:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 07:01:47 2024
Received: from localhost ([127.0.0.1]:45664 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQ3Ap-0002LF-5k
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 07:01:47 -0400
Received: from mail.muc.de ([193.149.48.3]:48813)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sQ3Am-0002L0-Tk
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 07:01:45 -0400
Received: (qmail 76333 invoked by uid 3782); 6 Jul 2024 13:01:35 +0200
Received: from muc.de (p4fe15482.dip0.t-ipconnect.de [79.225.84.130]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 06 Jul 2024 13:01:35 +0200
Received: (qmail 31186 invoked by uid 1000); 6 Jul 2024 11:01:34 -0000
Date: Sat, 6 Jul 2024 11:01:34 +0000
To: Andrea Corallo <acorallo@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
Message-ID: <ZokkDv-tWbLuIFDh@ACM>
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <yp1le2fgdul.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <yp1le2fgdul.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: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, acm@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 71934 <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, Andrea.

On Sat, Jul 06, 2024 at 03:48:50 -0400, Andrea Corallo wrote:
> Alan Mackenzie <acm@HIDDEN> writes:

> > Hello, Stefan.

> > On Fri, Jul 05, 2024 at 14:17:38 -0400, Stefan Monnier wrote:
> >> > Not sure what you mean by "no such thing as a form ... like a closure".

> >> A form that starts with `closure` is not a valid form because there is
> >> no definition for `closure`: (fboundp 'closure) => nil.

> >> > I bumped into one last summer.

> >> > In particular (in my development repo fixing bug #64646) I put this into
> >> > *scratch*:

> >> >     (defconst foo (lambda (baz) (car baz)))

> >> > , evaluated it with C-x C-e and then M-: (native-compile foo).  This
> >> > threw the error "Cannot native-compile, form is not a lambda".

> >> That error seems right according to the docstring:

> >>    (defun native-compile (function-or-file &optional output)
> >>      "Compile FUNCTION-OR-FILE into native code.
> >>    This is the synchronous entry-point for the Emacs Lisp native
> >>    compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
> >>    filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
> >>    it as the filename for the compiled object.  If FUNCTION-OR-FILE
> >>    is a filename, if the compilation was successful return the
> >>    filename of the compiled object.  If FUNCTION-OR-FILE is a
> >>    function symbol or a form, if the compilation was successful
> >>    return the compiled function."

> >> (closure ...) is not a function symbol nor a valid form.  Instead it's
> >> a function value and the docstring doesn't say such are
> >> a valid arguments to `native-compile`.

> > All very clever arguments, no doubt, but in the end it means you cannot
> > native compile foo.  I've just tried it on emacs-30, and it doesn't work.
> > But you could compile foo last summer after my fixes for bug #64646.
> > Between last summer and now, something has gone badly wrong in Emacs's
> > basic mechanisms.

> (defconst foo (lambda (baz) (car baz)))                                                                                                                                           
> (native-compile #'foo)

> Never worked AFAIR, ....

No.  But (native-compile foo) did work.  It compiled the value of foo,
producing an anonymous subr.

> ....the functionality you added was:

> (defun foo () "foo doc string"
>        (lambda () "lambda doc string" 3))

> (subr-native-elisp-p (funcall (native-compile 'foo)))

Yes.

> And this still works for me.

It still works for me, too.

> I'm probably missing something sorry.

The fact that

	(defconst foo (lambda (baz) (car baz)))
	(native-compile foo)

worked (as of 2023-11-08), but no longer does.  It was not the main topic
of bug #64646 (for which see above), but was fixed in the commit for that
bug anyway.  This was possibly not a good idea.  That commit was:

commit 06e4ebc81a44c709b08ce72c746629c6c77e6f6e
Author: Alan Mackenzie <acm@HIDDEN>
Date:   Wed Nov 8 20:49:48 2023 +0000

    With `native-compile', compile lambdas in a defun or lambda too

..

>   Andrea

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 08:06:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 04:06:38 2024
Received: from localhost ([127.0.0.1]:45549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQ0RJ-00069z-Nt
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 04:06:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sQ0RH-00069m-Jt
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 04:06:36 -0400
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 <acorallo@HIDDEN>)
 id 1sQ0R7-0007Gv-Jx; Sat, 06 Jul 2024 04:06:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=QtFYhmtgRKmFY+dwdJ/R++wYl9wdvPYn8YkjTl2mx6Y=; b=fQWP/orGh/kjUmKKLkh1
 Wa0Tl/276YtdjBeyDCl1lfsxiQihMM08BaUwViazKLMHT6ypeTOJT6T4pQDf3k4f2jmIAeQAbQXMX
 s4IxZvC+MyHECDXDQaEcvld6/Wtm5YEhlUZW6qINtySaaPKcir9vC/OrJcOys85gwbyvvYtbkdPIM
 s64XUZr0IlbsUmj66TXsgeMPIrY1DdlYjPxPfHhPgB+RBcrpYjRbi2lnzn/QgdYl676rFnwPA5Kv2
 4HkO8bDVu/ZXaWvVqLDUywHyhWQ4XVS7Z7Q4pYDjpyvja6kfot2mw0U4hx7BOuKSdKcaZdBME1up8
 FMAwzRy9RwdZ1w==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sQ0R7-0004mD-8A; Sat, 06 Jul 2024 04:06:25 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <86plrr58nv.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 06 Jul
 2024 09:36:20 +0300")
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
 <87bk3b8h2n.fsf@HIDDEN> <86plrr58nv.fsf@HIDDEN>
Date: Sat, 06 Jul 2024 04:06:25 -0400
Message-ID: <yp1h6d3gd1a.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, acm@HIDDEN,
 monnier@HIDDEN, 71934 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Michael Heerdegen <michael_heerdegen@HIDDEN>
>> Cc: Stefan Monnier <monnier@HIDDEN>,  Andrea Corallo
>>  <acorallo@HIDDEN>,  Eli Zaretskii <eliz@HIDDEN>,  71934 <at> debbugs.gnu.org
>> Date: Sat, 06 Jul 2024 03:06:24 +0200
>> 
>> Alan Mackenzie <acm@HIDDEN> writes:
>> 
>> > > > All very clever arguments, no doubt, but in the end it means you
>> > > > cannot native compile foo.
>> >
>> > > To obey the docstring, ....
>> >
>> > Forget that doc string, just do what is right, expected, and convenient
>> > for Emacs users, and adjust the doc string afterwards.
>> 
>> We are actually trying to do that, but we don't understand the code
>> because of the lacking or wrong documentation.
>
> I don't understand this difficulty.  Andrea, who wrote that function
> (and everything around it) is here, and is very helpful.  How come
> this lack of understanding, let alone lack of documentation, is still
> with us?

Must say I'm really lost in this thread.

First I don't understand the functionality that got lost.

Second the method "comp-spill-lap-function ((form list))" never served the
case (native-compile 'foo) but rather (native-compile '(lambda () 3)).

(Now if the form (closure () 3) does not exist in elisp as valid form
this might translate in 1 line fix in 'comp-spill-lap-function ((form
list))' but let discuss this aside and is not about a lost
functionality).

(native-compile 'foo) is served by 'comp--spill-lap-function ((function-name symbol))'.

Also:

(native-compile 'foo) works (as always did) and even what Alan added
(native compiling lambdas in function native compiled by symbol name)
that is:

(defun foo () "foo doc string"
       (lambda () "lambda doc string" 3))

(subr-native-elisp-p (funcall (native-compile 'foo)))

Still works for me on master.

So I must be really missing something in this discussion.

Let us please stick to exactly what worked in which version and what
does not in which other version, if we identify a case will be easy to
fix.

And even more importantly, I'll make sure we have a test that covers
that case so we can't have any other regression (assuming we had one).

Thanks

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 07:51:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 03:51:13 2024
Received: from localhost ([127.0.0.1]:45519 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sQ0CP-0005gX-CT
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 03:51:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58890)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sQ0CM-0005gH-GY
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 03:51:11 -0400
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 <acorallo@HIDDEN>)
 id 1sQ0A7-0006Md-NS; Sat, 06 Jul 2024 03:48:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=M4/tRwl/Qy0aQDewolr5ogR3T4FjeTKjxEUrJqUQ24E=; b=ZIQOmO9r8nvoUpxsnu9X
 TBVaF3PtPJHJBN5aNjiMEYGQwpFUL+hIMo6XByIJQRFw3qCff/wLYa+EN4fxJYty+AYFdi9UwFl18
 YpTmMcW4LvU67mcL0+lbCYvRc2kWxhw8T06z5HlEYIRDOGo8In23rJwDgGLrk3j/FB8fNpVVwZ4RO
 LouB74a+Zz3VBc26kbn6ZGuxekvO+ivvqgIYchE5StFC8/y83ZYp/CFeedHAcYJhiw85Fe6ZkHlsZ
 Qacs5Kl1WDhX3jT7n3rNc8KYVbxQDjZ0jO1jerBR3gWgvFUKujIg6y2uR/0WLTDPFt6PMVAscl/NX
 BzNo9ISwU/YYzA==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sQ0A7-00082Q-1R; Sat, 06 Jul 2024 03:48:51 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <ZohPp8z4PgCCrbqX@ACM> (Alan Mackenzie's message of "Fri, 5 Jul
 2024 19:55:19 +0000")
References: <87sewo5vym.fsf@HIDDEN> <jwva5iweatz.fsf-monnier+emacs@HIDDEN>
 <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
Date: Sat, 06 Jul 2024 03:48:50 -0400
Message-ID: <yp1le2fgdul.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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 (---)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Stefan.
>
> On Fri, Jul 05, 2024 at 14:17:38 -0400, Stefan Monnier wrote:
>> > Not sure what you mean by "no such thing as a form ... like a closure".
>
>> A form that starts with `closure` is not a valid form because there is
>> no definition for `closure`: (fboundp 'closure) => nil.
>
>> > I bumped into one last summer.
>
>> > In particular (in my development repo fixing bug #64646) I put this into
>> > *scratch*:
>
>> >     (defconst foo (lambda (baz) (car baz)))
>
>> > , evaluated it with C-x C-e and then M-: (native-compile foo).  This
>> > threw the error "Cannot native-compile, form is not a lambda".
>
>> That error seems right according to the docstring:
>
>>    (defun native-compile (function-or-file &optional output)
>>      "Compile FUNCTION-OR-FILE into native code.
>>    This is the synchronous entry-point for the Emacs Lisp native
>>    compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
>>    filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
>>    it as the filename for the compiled object.  If FUNCTION-OR-FILE
>>    is a filename, if the compilation was successful return the
>>    filename of the compiled object.  If FUNCTION-OR-FILE is a
>>    function symbol or a form, if the compilation was successful
>>    return the compiled function."
>
>> (closure ...) is not a function symbol nor a valid form.  Instead it's
>> a function value and the docstring doesn't say such are
>> a valid arguments to `native-compile`.
>
> All very clever arguments, no doubt, but in the end it means you cannot
> native compile foo.  I've just tried it on emacs-30, and it doesn't work.
> But you could compile foo last summer after my fixes for bug #64646.
> Between last summer and now, something has gone badly wrong in Emacs's
> basic mechanisms.

(defconst foo (lambda (baz) (car baz)))                                                                                                                                           
(native-compile #'foo)

Never worked AFAIR, the functionality you added was:

(defun foo () "foo doc string"
       (lambda () "lambda doc string" 3))

(subr-native-elisp-p (funcall (native-compile 'foo)))

And this still works for me.

I'm probably missing something sorry.

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 07:34:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 03:34:09 2024
Received: from localhost ([127.0.0.1]:45480 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPzvt-0005AK-FC
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 03:34:09 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59602)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sPzvr-0005A5-RU
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 03:34:08 -0400
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 <acorallo@HIDDEN>)
 id 1sPzvi-00084L-BK; Sat, 06 Jul 2024 03:33:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=Y2s9nC0MxeVheKeotXzO5XAQOiJCgBj1NSght5ByX1I=; b=GucByhk3huO5Pu9iiIeV
 dZL7B+myT8mhDwfamLlxuUvY2QGCNvlc8XotbNzLoGtlbrS0C2kx5y575OZbdFZgApzwvfKQalwPf
 LhSpqpt2eCysf0Y22Qza8R0nfblV37uPNsXRKKwV4vUK0IBYn3j+NpWJqI94izfMEOf5Rvwhr4GMA
 4KasMRQJtuxVJ1q2LuVPgNHtltp9YdoUTwpnamffZ3ctQrL/Q12xZK/pf/R12MUTMACtlZclRz5XR
 GAjObcmkOIbnPrFNjNQ9J0znbphkJiVpSGIOFHSF5qSZhP55G1bQyClHplFdjn9nqW7c+9ZSiwCqy
 Q8/KWdyKduqlng==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sPzvi-0003Tl-2Z; Sat, 06 Jul 2024 03:33:58 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <Zogj1XE39AgJom0Z@ACM> (Alan Mackenzie's message of "Fri, 5 Jul
 2024 16:48:21 +0000")
References: <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
 <jwva5iweatz.fsf-monnier+emacs@HIDDEN> <87zfqwh1gb.fsf@HIDDEN>
 <86o77c75jd.fsf@HIDDEN> <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
Date: Sat, 06 Jul 2024 03:33:57 -0400
Message-ID: <yp1plrrgeje.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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 (---)

Alan Mackenzie <acm@HIDDEN> writes:

> Hello, Stefan.
>
> On Fri, Jul 05, 2024 at 11:48:10 -0400, Stefan Monnier wrote:
>> >> >> Andrea, can you take a look at this, please?
>> >> > Yep, I believe that code does not require to be changed, the input of
>> >> > comp--spill-lap-function is a form not an interpred function.
>> >> But then why does it check for `closure`?
>> > Back in 2023, one of the forms this function found itself unable to
>> > compile was a closure.  So I fixed this for bug #64646.
>
>> But there is no such thing as a *form* that looks like
>> (closure ...), so if we found such a thing either it was a bug or it
>> means that other function values like byte-code (or the new
>> `interpreted-function`s) could appear there and should arguably be
>> handled as well.
>
> Not sure what you mean by "no such thing as a form ... like a closure".
> I bumped into one last summer.
>
> In particular (in my development repo fixing bug #64646) I put this into
> *scratch*:
>
>     (defconst foo (lambda (baz) (car baz)))
>
> , evaluated it with C-x C-e and then M-: (native-compile foo).  This
> threw the error "Cannot native-compile, form is not a lambda".

I'm a little confused, I believe #64646 was about:

(defun foo ())
(native-compile 'foo)

Which still works for me on emacs-30, no?

  Andrea




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 06:36:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 06 02:36:34 2024
Received: from localhost ([127.0.0.1]:45433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPz2A-0000cM-0g
	for submit <at> debbugs.gnu.org; Sat, 06 Jul 2024 02:36:34 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39172)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sPz27-0000c9-W7
 for 71934 <at> debbugs.gnu.org; Sat, 06 Jul 2024 02:36:32 -0400
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 1sPz1x-0007SX-PX; Sat, 06 Jul 2024 02:36:21 -0400
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=bb+YWgoQdJIZOZQR+onacXjPCxHcTKMHztdelY8X0Do=; b=eU94vPVl8GVh
 raRzFtJHf1T8wMxYdfQBHFgQOvFpFkt+52rcufF+t3GFqxuFGbIGJs0B0HLIcrNsCtg9aV/+K1Inb
 L28jIHhkcC+u/QTGlXAhqBdoepcD9bwcNDJFWp6VIfsTLFMNiZOy1KWMJYPrT4aMby/zGcCiMLZBJ
 ZRfMZsDOGQ7FeBhy7oSF/aB6r1lkYqQF77PU/8pmDJQKJrpRBMlscLRBqIrkU0bN/2d6VTV3wkVVz
 MA8sq5hy4fdMsVDydQZ+yQIo1Ia3DUtxenxHXNJTLuYWUmcKlPs8+HF+ibDAdw5YkRi+ojQmmwwcm
 a6SGuRkUHWyKGUufA1dKIA==;
Date: Sat, 06 Jul 2024 09:36:20 +0300
Message-Id: <86plrr58nv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
In-Reply-To: <87bk3b8h2n.fsf@HIDDEN> (message from Michael Heerdegen on Sat,
 06 Jul 2024 03:06:24 +0200)
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
 <87bk3b8h2n.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: acm@HIDDEN, acorallo@HIDDEN, monnier@HIDDEN,
 71934 <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 (---)

> From: Michael Heerdegen <michael_heerdegen@HIDDEN>
> Cc: Stefan Monnier <monnier@HIDDEN>,  Andrea Corallo
>  <acorallo@HIDDEN>,  Eli Zaretskii <eliz@HIDDEN>,  71934 <at> debbugs.gnu.org
> Date: Sat, 06 Jul 2024 03:06:24 +0200
> 
> Alan Mackenzie <acm@HIDDEN> writes:
> 
> > > > All very clever arguments, no doubt, but in the end it means you
> > > > cannot native compile foo.
> >
> > > To obey the docstring, ....
> >
> > Forget that doc string, just do what is right, expected, and convenient
> > for Emacs users, and adjust the doc string afterwards.
> 
> We are actually trying to do that, but we don't understand the code
> because of the lacking or wrong documentation.

I don't understand this difficulty.  Andrea, who wrote that function
(and everything around it) is here, and is very helpful.  How come
this lack of understanding, let alone lack of documentation, is still
with us?




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

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


Received: (at 71934) by debbugs.gnu.org; 6 Jul 2024 01:05:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 21:05:52 2024
Received: from localhost ([127.0.0.1]:45257 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPts8-0001rY-EG
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 21:05:52 -0400
Received: from mout.web.de ([217.72.192.78]:41943)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sPts7-0001rI-2b
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 21:05:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1720227934; x=1720832734;
 i=michael_heerdegen@HIDDEN;
 bh=xYzbbuIJrfoqxT03M71xdtLMnnZ99OuzS/fZmi7qZ4Q=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=GBDe+l+ySxJpfI3u4A1IC9VKh7jPEWWi5jfznaYNmJVDOXMaQmPZ8/+qvgfMvDti
 0b2AMXXx28wQkFRcmgs00Q9LoyehXdB2ykbSTTY3j3x0Umoa/rbfUInjm1FQ1OALn
 k/dl+f7pxE+7ilYldh60rNYg0ksIGW+S6KS7Kree4Ipshvv9WtdbpxXdcBAcwSZiT
 z9R3lR4Asib21vxgXeS5/vDaLIAAop0JcfG1gZEcK4l11uE2CA0oV7rL3LxwICEmt
 faqR2FgYvPkpeodvpihowqsakYZxbR1UortVAFAleh3AHagQRXTJj/lJm0RAO271E
 uEUG8vBuXuFR081kyQ==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.113]) by smtp.web.de (mrweb106
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MDdyH-1safNZ0XNH-0040Ei; Sat, 06
 Jul 2024 03:05:34 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <ZohohZGpcOPTJwKR@ACM> (Alan Mackenzie's message of "Fri, 5 Jul
 2024 21:41:25 +0000")
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN> <ZohohZGpcOPTJwKR@ACM>
Date: Sat, 06 Jul 2024 03:06:24 +0200
Message-ID: <87bk3b8h2n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:TuHLIY7PkQkP5qsekHYQ+kLvpQGPNEWh+6vcSe5AZYzzRmLOTpG
 SGMB9YbmfZTygKvTVByIYttK8ED4OM2MajvexmimkKF3ICq6piievP/CBAJZC1nMwOxR2Zr
 98Va1UhqBjWdIZoBmQapMba2xxHgksPERRwK+IJmQAPtNZJFiukKo1jGXVVj/Iz+LMd3Vk1
 9Xj340DWUBdFm+zI7HsaA==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:O83v7HtgRSA=;TfzQFkx5cG8eq8utnP+HNWn5NaI
 rBAHFTyNhnNR58mndwqya90RlIRsKx2y+vekdOs33Ww5D/hQ2Ejk3vuqC9pwqzQrRo7yG2HtU
 hNCPrbMJNUkrmPXG6678U+Bs/f2jks5zqgIvP0uSQ3m5Viv6OwA8IytCSOVMX3B8zSOVbAoyf
 a0CSt79BIXZg4rj4+VGwyYQ1HLfRYrRqEguFrSHDrFMKny8xt+0VYx6ji7TvPRQqU5mOdQAgF
 9sXSWkWBH+iRmPiOoCvLRT/IGSKNutUDQCz46YkcQrl56fo69+Ou0hX6BFGjWI2CQggQush5+
 l1O3t5/JDKik9JL6sFkVYzWp6IHJeoZ5FIY7W2X7jwMkldxHCSIaY42Q3sWrMqyhaMXqiFvlH
 9V2NZ0hsAq5MGWYx+UNHD54CP3DF9ek/7QplqCq0xAmcsYiQTvbY6WpZx92P7o7Pe3HMVmdeU
 18FBJzXAY5CW1QSURUti3cgI7oLrAxg3HOnXUqYOnsEC1cLfIAGEEcqkhufGDEaVkKpUqNE34
 figPbu9iEmcsyLjN90fQtJf5raB1cw8MoSOBfDXy0aVN7V2qI73+Rx8i2yICmUWkabr1Womv8
 cup3VqcpSxqdpK9T/nSiCx2ZxRJqe9kdIFKAHIad4CELnOtEG5VYqIT1ye/y83h7w86IMXv15
 6nEnUbVKyiXKoL+LhlYcu6fr6eIBl/H2J2XYDqnS3ooTr9LUjN2Lg+Z5H0J3cveDaxavNar6d
 3LxSwo6dQTIHqVtDUqmY34vT0+LSFxc/XMahIKN2r+OGTp1b4VHNhzevdYXevG438sBR9IlXq
 bLrEyl4IHUyi8knW81OomgM1LNMFcJyCGfmB7huXSfjaU=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 71934
Cc: Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 71934 <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.7 (-)

Alan Mackenzie <acm@HIDDEN> writes:

> > > All very clever arguments, no doubt, but in the end it means you
> > > cannot native compile foo.
>
> > To obey the docstring, ....
>
> Forget that doc string, just do what is right, expected, and convenient
> for Emacs users, and adjust the doc string afterwards.

We are actually trying to do that, but we don't understand the code
because of the lacking or wrong documentation.

Maybe we already had introduced a regression because of that.  And now
three people try to guess what the code does.  Our time is also
valuable, Alan.  This documentation is important.

Michael.




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

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


Received: (at 71934) by debbugs.gnu.org; 5 Jul 2024 21:41:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 17:41:39 2024
Received: from localhost ([127.0.0.1]:45107 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPqgV-0004MJ-8U
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 17:41:39 -0400
Received: from mail.muc.de ([193.149.48.3]:39770)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sPqgT-0004M6-8Y
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 17:41:37 -0400
Received: (qmail 4109 invoked by uid 3782); 5 Jul 2024 23:41:27 +0200
Received: from muc.de (pd953a1ab.dip0.t-ipconnect.de [217.83.161.171]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 05 Jul 2024 23:41:27 +0200
Received: (qmail 30510 invoked by uid 1000); 5 Jul 2024 21:41:26 -0000
Date: Fri, 5 Jul 2024 21:41:25 +0000
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
Message-ID: <ZohohZGpcOPTJwKR@ACM>
References: <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
 <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv5xtjd2do.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: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, acm@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 71934 <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 Fri, Jul 05, 2024 at 16:26:02 -0400, Stefan Monnier wrote:
> >> (closure ...) is not a function symbol nor a valid form.  Instead it's
> >> a function value and the docstring doesn't say such are
> >> a valid arguments to `native-compile`.

> > All very clever arguments, no doubt, but in the end it means you cannot
> > native compile foo.

> To obey the docstring, ....

Forget that doc string, just do what is right, expected, and convenient
for Emacs users, and adjust the doc string afterwards.

> > I've just tried it on emacs-30, and it doesn't work.

> As it is allowed to, according to its docstring.

Forget that doc string.  It belongs to lawyers, not reality.

> > But you could compile foo last summer after my fixes for bug #64646.

> [ But that still failed to make it work for byte-compiled function values,
>   and it failed to update the docstring to announce that new behavior.  ]

That is a strawman.  You have never been able to compile from
byte-compiled code to native compiled code, and never will (unless
Andrea has anything new to the contrary to say).  

The point is being able to compile foo, from read source code.  You
don't want to be able to do this for reasons I can't fathom.

> >> Admittedly, maybe we should extend `native-compile` to accept function
> >> values, just like `byte-compile`.
> > Or something like that, yes.  But if logical combinations of terms like
> > "form", "closure", "function value", "valid form" lead to not being able
> > to compile foo, then I suggest that these terms and their applicability
> > might need to be thought through somewhat.

> Don't worry: they've been thought through aplenty.

Clearly not.  The confusion they're apparently causing is affecting Emacs.

> >>> So I fixed comp--spill-lap-function (form version) so as to compile
> >>> that form.
> >> Why `comp--spill-lap-function` specifically (instead of
> >> `native-compile`, for example)?
> > I fixed what was wrong at the time.

> I'd like to implement the feature of `native-compile` accepting function
> values correctly rather than in the most expedient way.  If you could
> try to remember why you fixed it in this specific way, ....

I have no records of my reasons.  Having diagnosed the problem, it was
not difficult to fix.  I just fixed it in the simplest, most obvious,
and most obviously correct way.

> .... that would be very helpful, because I'm not sufficiently familiar
> with the code of `comp--spill-lap-function` to be sure of what I'm
> doing.

> >> > I've no idea how Emacs would handle that defconst now.
> >> Hmm... AFAICT your example doesn't relate to `defconst`.
> >> You'd get the same result with
> >>     M-: (native-compile (lambda (baz) (car baz))) RET
> > Whatever.  foo doesn't compile; that should be fixed.

> All I'm saying is that it's a feature request, rather than a bug to
> be fixed.

Functionality has been lost.  Finding an excuse in the exact meaning of
words rarely used with such precision is not a way to restore that
functionality.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 71934) by debbugs.gnu.org; 5 Jul 2024 20:26:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 16:26:16 2024
Received: from localhost ([127.0.0.1]:45086 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPpVY-0002DZ-DO
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 16:26:16 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54324)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sPpVW-0002DM-LL
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 16:26:15 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AB50D44465C;
 Fri,  5 Jul 2024 16:26:05 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720211163;
 bh=3MrwPAhhyzi0T1PnoT6KLv+GsLgeAp/GFYLutIEm01g=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=lqXAHG6PG4SUdFIRsSQZJcir56BV8+mI1Iekj6iwd3VT+M72J7DpEq29xqBLYz+Mr
 PC6sRG/hOw32qCrmD3SmuETQz/KgtOORXrLJODw3eozKlvb+4Aaf5ewaEHEZhIbLe5
 ieJd9e+lU+duM/MLEMsoxyG1t7ggE4WHluv/CcgKkxG7khIFiQxJBhbVPUIu2SZ14Z
 n7Q6rj8CMxiJYy6FaHPFAuiiIDgJ5zwol3OmJUqW7t8AKwdLNhnVL8EK9NEPOMfF/v
 2z58JVK+oaZ1EK2hr8S7iUA2bYOu4t3iUYFf92Tfv1nZ576bo749VTXX8N7adgU+zU
 rfussam1pVasw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C8D97444654;
 Fri,  5 Jul 2024 16:26:03 -0400 (EDT)
Received: from pastel (unknown [45.72.245.253])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8DB3B120A19;
 Fri,  5 Jul 2024 16:26:03 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <ZohPp8z4PgCCrbqX@ACM> (Alan Mackenzie's message of "Fri, 5 Jul
 2024 19:55:19 +0000")
Message-ID: <jwv5xtjd2do.fsf-monnier+emacs@HIDDEN>
References: <87sewo5vym.fsf@HIDDEN> <jwva5iweatz.fsf-monnier+emacs@HIDDEN>
 <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN> <ZohPp8z4PgCCrbqX@ACM>
Date: Fri, 05 Jul 2024 16:26:02 -0400
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.468 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Andrea Corallo <acorallo@HIDDEN>, 71934 <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 (---)

>> (closure ...) is not a function symbol nor a valid form.  Instead it's
>> a function value and the docstring doesn't say such are
>> a valid arguments to `native-compile`.
>
> All very clever arguments, no doubt, but in the end it means you cannot
> native compile foo.

To obey the docstring, if you want to compile a function whose value is
stored in the variable `foo` you can do:

    (let ((sym (gensym)))
      (fset sym foo)
      (native-compile sym))

It's admittedly not the most convenient, which is why `byte-compile`
(in contrast to `native-compile`) accepts function values in addition to
forms and function symbols.

> I've just tried it on emacs-30, and it doesn't work.

As it is allowed to, according to its docstring.

> But you could compile foo last summer after my fixes for bug #64646.

[ But that still failed to make it work for byte-compiled function values,
  and it failed to update the docstring to announce that new behavior.  ]

>> Admittedly, maybe we should extend `native-compile` to accept function
>> values, just like `byte-compile`.
> Or something like that, yes.  But if logical combinations of terms like
> "form", "closure", "function value", "valid form" lead to not being able
> to compile foo, then I suggest that these terms and their applicability
> might need to be thought through somewhat.

Don't worry: they've been thought through aplenty.

>>> So I fixed comp--spill-lap-function (form version) so as to compile
>>> that form.
>> Why `comp--spill-lap-function` specifically (instead of
>> `native-compile`, for example)?
> I fixed what was wrong at the time.

I'd like to implement the feature of `native-compile` accepting function
values correctly rather than in the most expedient way.  If you could
try to remember why you fixed it in this specific way, that would be
very helpful, because I'm not sufficiently familiar with the code of
`comp--spill-lap-function` to be sure of what I'm doing.

>> > I've no idea how Emacs would handle that defconst now.
>> Hmm... AFAICT your example doesn't relate to `defconst`.
>> You'd get the same result with
>>     M-: (native-compile (lambda (baz) (car baz))) RET
> Whatever.  foo doesn't compile; that should be fixed.

All I'm saying is that it's a feature request, rather than a bug to
be fixed.


        Stefan





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

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


Received: (at 71934) by debbugs.gnu.org; 5 Jul 2024 19:55:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 15:55:34 2024
Received: from localhost ([127.0.0.1]:45075 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPp1q-0001JX-5p
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 15:55:34 -0400
Received: from mail.muc.de ([193.149.48.3]:62555)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sPp1o-0001JG-Ps
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 15:55:33 -0400
Received: (qmail 85049 invoked by uid 3782); 5 Jul 2024 21:55:21 +0200
Received: from muc.de (pd953a1ab.dip0.t-ipconnect.de [217.83.161.171]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 05 Jul 2024 21:55:20 +0200
Received: (qmail 28079 invoked by uid 1000); 5 Jul 2024 19:55:19 -0000
Date: Fri, 5 Jul 2024 19:55:19 +0000
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
Message-ID: <ZohPp8z4PgCCrbqX@ACM>
References: <87sewo5vym.fsf@HIDDEN> <jwva5iweatz.fsf-monnier+emacs@HIDDEN>
 <87zfqwh1gb.fsf@HIDDEN> <86o77c75jd.fsf@HIDDEN>
 <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
 <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwvjzhz7m4l.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: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, acm@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 71934 <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 Fri, Jul 05, 2024 at 14:17:38 -0400, Stefan Monnier wrote:
> > Not sure what you mean by "no such thing as a form ... like a closure".

> A form that starts with `closure` is not a valid form because there is
> no definition for `closure`: (fboundp 'closure) => nil.

> > I bumped into one last summer.

> > In particular (in my development repo fixing bug #64646) I put this into
> > *scratch*:

> >     (defconst foo (lambda (baz) (car baz)))

> > , evaluated it with C-x C-e and then M-: (native-compile foo).  This
> > threw the error "Cannot native-compile, form is not a lambda".

> That error seems right according to the docstring:

>    (defun native-compile (function-or-file &optional output)
>      "Compile FUNCTION-OR-FILE into native code.
>    This is the synchronous entry-point for the Emacs Lisp native
>    compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
>    filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
>    it as the filename for the compiled object.  If FUNCTION-OR-FILE
>    is a filename, if the compilation was successful return the
>    filename of the compiled object.  If FUNCTION-OR-FILE is a
>    function symbol or a form, if the compilation was successful
>    return the compiled function."

> (closure ...) is not a function symbol nor a valid form.  Instead it's
> a function value and the docstring doesn't say such are
> a valid arguments to `native-compile`.

All very clever arguments, no doubt, but in the end it means you cannot
native compile foo.  I've just tried it on emacs-30, and it doesn't work.
But you could compile foo last summer after my fixes for bug #64646.
Between last summer and now, something has gone badly wrong in Emacs's
basic mechanisms.

> Admittedly, maybe we should extend `native-compile` to accept function
> values, just like `byte-compile`.

Or something like that, yes.  But if logical combinations of terms like
"form", "closure", "function value", "valid form" lead to not being able
to compile foo, then I suggest that these terms and their applicability
might need to be thought through somewhat.

[ .... ]

> > So I fixed
> > comp--spill-lap-function (form version) so as to compile that form.

> Why `comp--spill-lap-function` specifically (instead of
> `native-compile`, for example)?

I fixed what was wrong at the time.

> > I've no idea how Emacs would handle that defconst now.

> Hmm... AFAICT your example doesn't relate to `defconst`.
> You'd get the same result with

>     M-: (native-compile (lambda (baz) (car baz))) RET

Whatever.  foo doesn't compile; that should be fixed.

> - Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 71934) by debbugs.gnu.org; 5 Jul 2024 18:17:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 14:17:41 2024
Received: from localhost ([127.0.0.1]:44965 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPnV7-0006ha-6D
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 14:17:41 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43913)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sPnV5-0006hJ-8Z
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 14:17:39 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9C2CC441F72;
 Fri,  5 Jul 2024 14:17:29 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720203447;
 bh=wtjboy2EbOht+UuMUI9DRA1O3TN35Bsinn3soH62szs=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=jF6caI26VbwnTzx4tmAmh8uCoJTyAuV6Ff27JpXqyDrQUusRvn76MO1IAQEXUKavR
 T9R2SmkeaLjC7YKrf6ctgyFfVA9OJ6ggFVz/fZTUM0pk9yRiLt9Z742iCFt6+dr05G
 dL4UUmGz53AHwxwIY7HB6zPdtBh2RnI2u/osyDKmwUYQ+g7tzYchcxahVYE8Q1k733
 WpEfOK8p2zguBf5MIJoNIgVu3XeolYVjRbvEhQD+hrvnTFt6eVwgkDLqH7uD3hCIaC
 HSYWhbfc2OHX1zJurbFVJA9gmJZM3zSLfkrGgdf/otBYm67rtCf7Z0PBM7Ie6tSI7R
 wiHy8NH/2ZnjA==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CC64944235C;
 Fri,  5 Jul 2024 14:17:27 -0400 (EDT)
Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A20C9120796;
 Fri,  5 Jul 2024 14:17:27 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
In-Reply-To: <Zogj1XE39AgJom0Z@ACM> (Alan Mackenzie's message of "Fri, 5 Jul
 2024 16:48:21 +0000")
Message-ID: <jwvjzhz7m4l.fsf-monnier+emacs@HIDDEN>
References: <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
 <jwva5iweatz.fsf-monnier+emacs@HIDDEN> <87zfqwh1gb.fsf@HIDDEN>
 <86o77c75jd.fsf@HIDDEN> <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN> <Zogj1XE39AgJom0Z@ACM>
Date: Fri, 05 Jul 2024 14:17:38 -0400
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.359 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 Andrea Corallo <acorallo@HIDDEN>, 71934 <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 (---)

> Not sure what you mean by "no such thing as a form ... like a closure".

A form that starts with `closure` is not a valid form because there is
no definition for `closure`: (fboundp 'closure) => nil.

> I bumped into one last summer.
>
> In particular (in my development repo fixing bug #64646) I put this into
> *scratch*:
>
>     (defconst foo (lambda (baz) (car baz)))
>
> , evaluated it with C-x C-e and then M-: (native-compile foo).  This
> threw the error "Cannot native-compile, form is not a lambda".

That error seems right according to the docstring:

   (defun native-compile (function-or-file &optional output)
     "Compile FUNCTION-OR-FILE into native code.
   This is the synchronous entry-point for the Emacs Lisp native
   compiler.  FUNCTION-OR-FILE is a function symbol, a form, or the
   filename of an Emacs Lisp source file.  If OUTPUT is non-nil, use
   it as the filename for the compiled object.  If FUNCTION-OR-FILE
   is a filename, if the compilation was successful return the
   filename of the compiled object.  If FUNCTION-OR-FILE is a
   function symbol or a form, if the compilation was successful
   return the compiled function."

(closure ...) is not a function symbol nor a valid form.  Instead it's
a function value and the docstring doesn't say such are
a valid arguments to `native-compile`.

Admittedly, maybe we should extend `native-compile` to accept function
values, just like `byte-compile`.

> The value of foo had been turned into a form (closure ....).

No, "form" is a specific term which denotes a piece of source code (I
usually used the term "expression" for that, but IIUC in the Lisp world
the more common term for that is "form").

(closure ....) is not a *form* code any more than (1 foo) or (+ . 4)
[ except to the extent that we *could* make it into a valid form by
  providing a definition for `closure` (as a macro, function, or
  special form).  ]

> So I fixed
> comp--spill-lap-function (form version) so as to compile that form.

Why `comp--spill-lap-function` specifically (instead of
`native-compile`, for example)?

> I've no idea how Emacs would handle that defconst now.

Hmm... AFAICT your example doesn't relate to `defconst`.
You'd get the same result with

    M-: (native-compile (lambda (baz) (car baz))) RET


- Stefan





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

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


Received: (at 71934) by debbugs.gnu.org; 5 Jul 2024 16:48:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 12:48:33 2024
Received: from localhost ([127.0.0.1]:44891 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPm6r-0004QL-Eo
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 12:48:33 -0400
Received: from mail.muc.de ([193.149.48.3]:41080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1sPm6q-0004Q8-DA
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 12:48:32 -0400
Received: (qmail 75644 invoked by uid 3782); 5 Jul 2024 18:48:23 +0200
Received: from muc.de (pd953a1ab.dip0.t-ipconnect.de [217.83.161.171]) (using
 STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 05 Jul 2024 18:48:22 +0200
Received: (qmail 15642 invoked by uid 1000); 5 Jul 2024 16:48:21 -0000
Date: Fri, 5 Jul 2024 16:48:21 +0000
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects)
Message-ID: <Zogj1XE39AgJom0Z@ACM>
References: <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
 <jwva5iweatz.fsf-monnier+emacs@HIDDEN> <87zfqwh1gb.fsf@HIDDEN>
 <86o77c75jd.fsf@HIDDEN> <yp11q48i5v6.fsf@HIDDEN>
 <jwvtth4c7f3.fsf-monnier+emacs@HIDDEN> <Zof2edaqLQfHD4_B@ACM>
 <jwvbk3b970b.fsf-monnier+emacs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwvbk3b970b.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: 71934
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, acm@HIDDEN,
 Eli Zaretskii <eliz@HIDDEN>, Andrea Corallo <acorallo@HIDDEN>,
 71934 <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 Fri, Jul 05, 2024 at 11:48:10 -0400, Stefan Monnier wrote:
> >> >> Andrea, can you take a look at this, please?
> >> > Yep, I believe that code does not require to be changed, the input of
> >> > comp--spill-lap-function is a form not an interpred function.
> >> But then why does it check for `closure`?
> > Back in 2023, one of the forms this function found itself unable to
> > compile was a closure.  So I fixed this for bug #64646.

> But there is no such thing as a *form* that looks like
> (closure ...), so if we found such a thing either it was a bug or it
> means that other function values like byte-code (or the new
> `interpreted-function`s) could appear there and should arguably be
> handled as well.

Not sure what you mean by "no such thing as a form ... like a closure".
I bumped into one last summer.

In particular (in my development repo fixing bug #64646) I put this into
*scratch*:

    (defconst foo (lambda (baz) (car baz)))

, evaluated it with C-x C-e and then M-: (native-compile foo).  This
threw the error "Cannot native-compile, form is not a lambda".

The value of foo had been turned into a form (closure ....).  So I fixed
comp--spill-lap-function (form version) so as to compile that form.

I've no idea how Emacs would handle that defconst now.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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

Message received at 71934-done <at> debbugs.gnu.org:


Received: (at 71934-done) by debbugs.gnu.org; 5 Jul 2024 08:46:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 04:46:21 2024
Received: from localhost ([127.0.0.1]:43559 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPeaD-000543-BH
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 04:46:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <acorallo@HIDDEN>) id 1sPeaB-00053p-CH
 for 71934-done <at> debbugs.gnu.org; Fri, 05 Jul 2024 04:46:20 -0400
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 <acorallo@HIDDEN>)
 id 1sPea1-00045T-VC; Fri, 05 Jul 2024 04:46:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=B5HcULvH5PsHFoxBvbMtljVSND+lOJaoXzHIMrrf6v4=; b=qNVZZUUue5geMervoNia
 4M3aTmR/BwvdOo/9diUTR1n7oby0m/rpQpmUvIVX/pebAwYsVaz1dbscI/hfhjRdeqOKkILFjbJxY
 GrLvpCDqxP9LC/acdskkVkmz0QWixdQGQgFjkgChhu1s9b1vQAsLvlvObtEkQWVq/KQC1LaIQtSXV
 YKU1cBt+RYBO8PwOPQvQhXVuDCE6rMdjo+6N2PwmMCpj01N4rt3hbLeMAEy1GjWJ4JCiT79+0p3yF
 0kTEroaAvP6cjdUBRpwvnSj3CajTSkYiJ+q9xIV8pU/L1Cmqf05wsM3TT7skAtPRIz+rOT4iVeJlv
 Pb7jIE2sKLAV3A==;
Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <acorallo@HIDDEN>)
 id 1sPeZx-0000qK-AY; Fri, 05 Jul 2024 04:46:09 -0400
From: Andrea Corallo <acorallo@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <86o77c75jd.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 05 Jul
 2024 08:48:38 +0300")
References: <877ce17ncn.fsf@HIDDEN> <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
 <jwva5iweatz.fsf-monnier+emacs@HIDDEN> <87zfqwh1gb.fsf@HIDDEN>
 <86o77c75jd.fsf@HIDDEN>
Date: Fri, 05 Jul 2024 04:46:05 -0400
Message-ID: <yp11q48i5v6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934-done
Cc: Michael Heerdegen <michael_heerdegen@HIDDEN>, 71934-done <at> debbugs.gnu.org,
 monnier@HIDDEN, acm@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: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: 71934-done <at> debbugs.gnu.org, Alan Mackenzie <acm@HIDDEN>
>> Date: Fri, 05 Jul 2024 07:06:44 +0200
>> From:  Michael Heerdegen via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>> 
>> Stefan Monnier <monnier@HIDDEN> writes:
>> 
>> > I already did.
>> 
>> What about `which-key--get-keymap-bindings-1'?
>> 
>> 
>> For this one I CC Alan M.:
>> 
>> > There's one case on `comp.el` which may require some update
>> 
>> Yes, that's more or less the only other one I found:
>> `comp--spill-lap-function'.  Alan, we are discussing how relevant the
>> code in that function is that checks for lambda and closure cars, and if
>> it must be updated to handle the new interpreted function objects.
>> 
>> > but I don't understand the code enough to know what it intends to
>> > do.  It seems to match both `lambda` and `closure`, hence function
>> > *values*, but somehow it doesn't try and handle byte-code functions
>> > which are far more common function values, so maybe the `closure` is
>> > just irrelevant and the code is expected to match source code
>> > expressions (whose evaluation will return functions)?
>> 
>> Dunno.  `comp-trampoline-compile' constructs a lambda form to compile.
>> But never a "closure form".  So maybe irrelevant to check for 'closure'
>> indeed.
>> 
>> Alan had added the 'closure' symbol in
>> 
>> 06e4ebc81a4 "With `native-compile', compile lambdas in a defun or lambda too"
>> 
>> which seems had been a fix for bug#64646 "Master: Native compiler
>> doesn't always compile lambda".  Guess this bug report is also an answer
>> to Stefan's question.
>
> Andrea, can you take a look at this, please?

Yep, I believe that code does not require to be changed, the input of
comp--spill-lap-function is a form not an interpred function.

  Andrea




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

Message received at 71934-done <at> debbugs.gnu.org:


Received: (at 71934-done) by debbugs.gnu.org; 5 Jul 2024 05:51:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 01:51:12 2024
Received: from localhost ([127.0.0.1]:43411 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPbqi-00062E-AU
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 01:51:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sPbqg-00061x-2h
 for 71934-done <at> debbugs.gnu.org; Fri, 05 Jul 2024 01:51:11 -0400
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 1sPboP-0003Jy-Er; Fri, 05 Jul 2024 01:48:49 -0400
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=Q3dEa1Xb4cMhHl9bvXBSLVoI5OkSVWNYplUFGRu5KYU=; b=kbj8huqhsXH4
 nJz2eGIKfWRcY1Y8R+5sKzdf7lp/Y1MXjo7Chpml1o1fjdsGZFip2D3EvoKMwo0lFiRpIRgZm7LFi
 pnTqCdmgU6EDJfkKBFxtef+/fhWZ+c8N2lntE3dVHT3Si3uvnQ0ZtKi7eEMKVHve2aaK9YPBsiYEb
 TJQAG1ypDC/qeGsQllULb6gUanEOoCqs5dh/gcOSkDSGg8XrGjmu4MXPfejnisu1a9HMpgkCWNbKV
 XiwpjZH0/Wm0xWzIaQF/XnWZdpzaW0FV4bhYk8n6fD4jp/J9s5rWq2sGbiqzJ8BlEYmW8xKVYyp3/
 LuYVFzKufc1wtRq6Vki6Gw==;
Date: Fri, 05 Jul 2024 08:48:38 +0300
Message-Id: <86o77c75jd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>,
 Andrea Corallo <acorallo@HIDDEN>
In-Reply-To: <87zfqwh1gb.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#71934: 31.0.50;
 edebug--called-interactively-skip vs. new fun objects
References: <877ce17ncn.fsf@HIDDEN> <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
 <jwva5iweatz.fsf-monnier+emacs@HIDDEN> <87zfqwh1gb.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934-done
Cc: 71934-done <at> debbugs.gnu.org, monnier@HIDDEN, acm@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: -3.3 (---)

> Cc: 71934-done <at> debbugs.gnu.org, Alan Mackenzie <acm@HIDDEN>
> Date: Fri, 05 Jul 2024 07:06:44 +0200
> From:  Michael Heerdegen via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Stefan Monnier <monnier@HIDDEN> writes:
> 
> > I already did.
> 
> What about `which-key--get-keymap-bindings-1'?
> 
> 
> For this one I CC Alan M.:
> 
> > There's one case on `comp.el` which may require some update
> 
> Yes, that's more or less the only other one I found:
> `comp--spill-lap-function'.  Alan, we are discussing how relevant the
> code in that function is that checks for lambda and closure cars, and if
> it must be updated to handle the new interpreted function objects.
> 
> > but I don't understand the code enough to know what it intends to
> > do.  It seems to match both `lambda` and `closure`, hence function
> > *values*, but somehow it doesn't try and handle byte-code functions
> > which are far more common function values, so maybe the `closure` is
> > just irrelevant and the code is expected to match source code
> > expressions (whose evaluation will return functions)?
> 
> Dunno.  `comp-trampoline-compile' constructs a lambda form to compile.
> But never a "closure form".  So maybe irrelevant to check for 'closure'
> indeed.
> 
> Alan had added the 'closure' symbol in
> 
> 06e4ebc81a4 "With `native-compile', compile lambdas in a defun or lambda too"
> 
> which seems had been a fix for bug#64646 "Master: Native compiler
> doesn't always compile lambda".  Guess this bug report is also an answer
> to Stefan's question.

Andrea, can you take a look at this, please?




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

Message received at 71934-done <at> debbugs.gnu.org:


Received: (at 71934-done) by debbugs.gnu.org; 5 Jul 2024 05:06:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 01:06:15 2024
Received: from localhost ([127.0.0.1]:43386 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPb9D-0004bS-JK
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 01:06:15 -0400
Received: from mout.web.de ([212.227.17.12]:43111)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sPb9B-0004bD-Ko
 for 71934-done <at> debbugs.gnu.org; Fri, 05 Jul 2024 01:06:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1720155954; x=1720760754;
 i=michael_heerdegen@HIDDEN;
 bh=9hUeRLK9xWI8fGEi2qXkbDiEqEcY1CdJEt9EYeoAQTM=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=kmasrMnw0uReJMo5GqFmRfwSTUXq/Pc0sbw/H9foiBvzBRyt1CIF72IvPvjIJO/v
 stEF1Q+LxZ4e7KmIAUwxPac21hz24bWNhScrSnu5XqGlkaP/SZ1Q43xARD4swfDRa
 AUUIkeyWxmd38KpOyWvvAXtQvUP7hynvX6B8VZlHVwI5sodl3JwRkCrIY8Qmae9H+
 0mg6z0GuqbG6EPk8odOKd32VLX7jD3KcsLu3fyWB09bNL6g9B0nxirxFpPtGORTUg
 gfFh38Z4xXazl1R9z15IVqsdMGeT++4A4ZxkozhJ4PHsaGRGXbuywrycMqlCd2LVr
 9GeCDt1wYuG8S18jTg==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.113]) by smtp.web.de (mrweb105
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MidHZ-1rszLR1cbH-00m8Q8; Fri, 05
 Jul 2024 07:05:54 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <jwva5iweatz.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Fri, 05 Jul 2024 00:24:55 -0400")
References: <877ce17ncn.fsf@HIDDEN> <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
 <jwva5iweatz.fsf-monnier+emacs@HIDDEN>
Date: Fri, 05 Jul 2024 07:06:44 +0200
Message-ID: <87zfqwh1gb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:ATRPH2UzO6GBMb+kmvI9zdPd78ppTbj/4R4CBfeEzZPUVSalnN9
 DSKPKs6LG64hfntSX91tZzODPQBc7pPLogc8dT2MFFA1C/Y4zl74TuS8qbGl9wAeA3hB3iA
 IcyxYwksEjvfQgvkCAcN6zKnPuOk2fbk1dAz6tisaNOU0fvyG93rjdfnnRl89kIp2NOsni7
 NP7i86dhGV0YanhoIldHw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:jm94+m4l304=;TSRWdE55Sg/SFMQoxAVVl9oGveK
 2OYV8TDa5Q3U6IEt3cBq7KnzWVEEaZbs7eUPHZo2WXB2cISGncvcI8WKWOlEyL+xIpaENCTyD
 bTKqvo36QKtXewrRWGZtVmf8Yrc2BOuc/GkCvpewiMRpk9qXOE2fqQdXI/mGEs0wOq+YB/x64
 hmkO8ovpwMrgridLIpBJVyNiJnt/7Btz6PjbPVdCRATPW6/dy8JPUZBCfIfpZRX/lPMLmYUUm
 C1BdBq/H7UqWcJkfNn1ou4ho4RVO0ctCZPhbAYyUH+NzoEk+I0iQKhuRHMZoExTidTkbNgcET
 WltlH8fZH7wxgWBlosivJuaxcd68TTVXspl65IizsMb1XeZemshYhaZklQChgdufQYQiikdAg
 HSvt6ntOCpd50kNWrnxsDT7mjX32PRnhJRnWONXOmg8lv6Oz7pUNj61w3hWpzsVO51a5wtV87
 qMAGfGYiUbN+CqiaIg7zXwyi9edkLEwULnYX2Chnk6g6O/e6Qk+SOwmF52BAHTAPas7kbEjvQ
 DF9uUNv2MDKh9b8UE4j3BDvZHERtHVejopsQs7zn2V0nLn7Yj8J1XX11A0+o1mQmsqEs1fMEr
 a2DGfP7+Rt2mSk3fecXRUraPsSNZ3MEuEGoULXCVwlDaX++PCkWWUPdPXHN72TXeZzKFwfMXg
 EUkCJOtTsSptnFVuSuE0zr1+AEmiAV1CPHqwuCkgNgABXnzjHLwGDxZO/VdhftauMel6n6+Rr
 vzXPoj6AOUTjqnmDY1RyJoPCDK3zRMsg7Xt4umgf7WMXvRvRdhsqBG0xTT9Zt3KCtwchBzLF/
 vymvN4Zr9riyn894mbD5BOsuDYVXix0kPuGvmHGNkHb+Y=
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 71934-done
Cc: 71934-done <at> debbugs.gnu.org, Alan Mackenzie <acm@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 (-)

Stefan Monnier <monnier@HIDDEN> writes:

> I already did.

What about `which-key--get-keymap-bindings-1'?


For this one I CC Alan M.:

> There's one case on `comp.el` which may require some update

Yes, that's more or less the only other one I found:
`comp--spill-lap-function'.  Alan, we are discussing how relevant the
code in that function is that checks for lambda and closure cars, and if
it must be updated to handle the new interpreted function objects.

> but I don't understand the code enough to know what it intends to
> do.  It seems to match both `lambda` and `closure`, hence function
> *values*, but somehow it doesn't try and handle byte-code functions
> which are far more common function values, so maybe the `closure` is
> just irrelevant and the code is expected to match source code
> expressions (whose evaluation will return functions)?

Dunno.  `comp-trampoline-compile' constructs a lambda form to compile.
But never a "closure form".  So maybe irrelevant to check for 'closure'
indeed.

Alan had added the 'closure' symbol in

06e4ebc81a4 "With `native-compile', compile lambdas in a defun or lambda too"

which seems had been a fix for bug#64646 "Master: Native compiler
doesn't always compile lambda".  Guess this bug report is also an answer
to Stefan's question.



Michael.




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

Message received at 71934-done <at> debbugs.gnu.org:


Received: (at 71934-done) by debbugs.gnu.org; 5 Jul 2024 04:25:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 00:25:20 2024
Received: from localhost ([127.0.0.1]:43342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPaVb-0003Tb-Os
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 00:25:20 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63841)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sPaVZ-0003TN-82
 for 71934-done <at> debbugs.gnu.org; Fri, 05 Jul 2024 00:25:18 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8378610005D;
 Fri,  5 Jul 2024 00:25:06 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720153505;
 bh=/t5s/OPX36rGb8txGetf5E7sO6HixInee4WOPE/5Zn0=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Z1KtNWVbixRxrK6TzrhAeHU5jZ7dQZqu47TQLSeWutMwBboZRywN3bMak8o3EVxCP
 ZxjcjXRsBBcPscJw5NFhy1U55HdZN+CjBNgt6CBo7R0YaLlySFYQo1aSfW60tVHaA4
 PbgDw2PIWp46+qy3RFETMAn23VhvZMVxkzGwTISfM+X2060mSWQrCZBT+MFOC3ISoL
 Gtwtujh6lu78MHlqmn+9Mz45Dpa9Hk8WfSWqtjf0lPW/dnZtWcB6t2KeSbw00Rz6c6
 3oDJ9h/gDq0Jf4fVKAS9f/6xVwraOLTtUGPLaxx0xS4KSNonBWuEUUPgpkKmE2nt9n
 IWyMMX5eDIxWw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4540A100042;
 Fri,  5 Jul 2024 00:25:05 -0400 (EDT)
Received: from pastel (unknown [45.72.245.253])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 12591120478;
 Fri,  5 Jul 2024 00:25:05 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <87sewo5vym.fsf@HIDDEN> (Michael Heerdegen's message of "Fri, 05
 Jul 2024 06:00:49 +0200")
Message-ID: <jwva5iweatz.fsf-monnier+emacs@HIDDEN>
References: <877ce17ncn.fsf@HIDDEN> <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> <87sewo5vym.fsf@HIDDEN>
Date: Fri, 05 Jul 2024 00:24:55 -0400
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.004 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934-done
Cc: 71934-done <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 pushed a patch to `emacs-30` which should fix this.
>> Can you confirm it fixes it in your real use case as well?
> Thanks.  Other use cases are fixed as well

Thank you, closing.

>  but advices are broken :-(
[...]
> (advice-add 'f :around (defun my-f--around-ad (f &rest args) (apply f args)))

AFAIK that's not new.

> Hitting [print] says nil.  AFAIU this should also work transparently,
> right?  The breakage seems to date further back in this case.

It should work for most advices but not for `:around` advice, because
fundamentally, it's virtually impossible to recognize this

    (apply f args)

as being an "interactive call".

> And i have another request: could you please search for the few other
> occurrences of the symbol 'closure' in the Emacs Elisp code base?
> I guess in most cases there is a need to update these places, too.

I already did.
There's one case on `comp.el` which may require some update, but I don't
understand the code enough to know what it intends to do.
It seems to match both `lambda` and `closure`, hence function *values*,
but somehow it doesn't try and handle byte-code functions which are far
more common function values, so maybe the `closure` is just irrelevant
and the code is expected to match source code expressions (whose
evaluation will return functions)?


        Stefan





Notification sent to Michael Heerdegen <michael_heerdegen@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Stefan Monnier <monnier@HIDDEN>:
You have taken responsibility. Full text available.

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


Received: (at 71934) by debbugs.gnu.org; 5 Jul 2024 04:00:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 00:00:18 2024
Received: from localhost ([127.0.0.1]:43333 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPa7N-0002qS-W8
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2024 00:00:18 -0400
Received: from mout.web.de ([212.227.15.4]:52395)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sPa7L-0002q3-L3
 for 71934 <at> debbugs.gnu.org; Fri, 05 Jul 2024 00:00:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1720151999; x=1720756799;
 i=michael_heerdegen@HIDDEN;
 bh=YJ6Wbm4L0RkMkeqfIXeUCqS3jyPIP506ybHlRyjuqpo=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=QDAfCmkV/SR2DxOUADnZbxoJEn05iYs+ZXrvsagObl4hX29tzEk2XLsn4YjYpAbh
 EhzC6sIKMGL54b4J86912MrNr4xaem7cu0hF8B19oRal6+3sJheTFsWxLxIDEf+fa
 GXgKXY5878rjPhSrHcQ+LCY58LYl/5ZuwOE7cwTcpBeSVISs7NaTQD+kWUfWD+jAr
 yJJwjvbeNSMRWfX6wncn10r9M+D5ms5ioa3sEuj38Jgxlr6YG27HUzfhqJ7JwreJc
 dfudQ/QHjGX7XymyqcvFPOWtCX0eGZddSfmPyXuCMdmsg2ho2kBckgL0mD5Fm+/8B
 7d5PEOng4FXceg4atw==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.113]) by smtp.web.de (mrweb005
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1Mq182-1s39Nl2RcY-00gLIc; Fri, 05
 Jul 2024 05:59:59 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Thu, 04 Jul 2024 11:47:58 -0400")
References: <877ce17ncn.fsf@HIDDEN> <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
 <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN>
Date: Fri, 05 Jul 2024 06:00:49 +0200
Message-ID: <87sewo5vym.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:SgUkCwmrZzs74iaOGHFCxmjHy9qauO+18x1/KD1xFLwwmhk/L6x
 yQidV43UQOhZd/82e3Lrz90CPSFh5FGYJ+4DIYh5d648ULd21fipIDzqpyuEOF/WjViSvUX
 XimdThCsrL3uAVan5NloCsNn/1Yc53pXY+l8laD6haTBQr+NzqBUQhTmtq0XjbPbDqAqM8y
 ScX0z7S/YPGvn24ricemg==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:FakDZBk5bpo=;8yf5Kh5pceDtpZ3aqekyN/zLayn
 z2LoirPEX6hhvrmqPRu4nwG4CEWFKMClbpDLpksnJ6xbzkSGTI1oyVu4brGtDOs/MGyahLFXi
 lquXidnHNgISoFz9pyqF4BoO4v/CrvPuNn1taDGT0Ktgb/XZsqPaJXjdNJ1jHO7W1vdNDk6Tu
 aTD4KSJlsQhgSAhC5SHmWhv++FvKr8FhZpAPyW6oCwYoASscsLj87ntG8PFehqb7WfhFWAKnX
 SDet4CmxAMDpET4MC4RXWWaFRKBB+oS7kXsS5xxqWSbfPjcsgJeI+Xik5bTrQF4hT1JN5HjTs
 xwr1Xk4kSI6RMnUWx7P7oCoFTH0wGVfiJquTVv4s9HjoyaFVoSEkB34ls3LGRcS5vhFoSAxwM
 EuM4HHq9n93vnELrkfGGiFrUp8yIfpCZTaM4Z6Rnf+rPg6ZU9STlv9XY48gRnUe2kR96MRNSx
 17Fyqc932adBDFwb08UDIWUpR9UHkcb5ON2qxAtSjcwoYdQyLUBVrHOHWbePfKIn43S40opk3
 DmSKeDzkP+ewkYUS/PwpGguTxEiERhoS9/W19ufyPOv36nosWIEmfYwlh/5t18HlzuB0Nk9qM
 SzT7umYdGXxO9GgA+4LMR/ilYC4JgT8xHJzoaSIBA2DE076vGIWhix1CfbRgyLe9Vm7Jg/umk
 oNTLJDk4hPjgROP7wN/1BOop5hmQKG3N2HrbskMkK8g1jKCxGxX6Drkur95Wwe57sCYDdE9fN
 jiMnrCJYDnIHJStARGFN1UY7AvrjuE2JWQW9h9QV3hjohdNWRXn2kFrALfLQNH+8+dbZb3h4B
 ucj2kEnc+A0zGb5Anwev0FMNcqJwRbVzfIWFZHTw6lTSM=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 71934
Cc: 71934 <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.7 (-)

Stefan Monnier <monnier@HIDDEN> writes:

> I pushed a patch to `emacs-30` which should fix this.
> Can you confirm it fixes it in your real use case as well?

Thanks.  Other use cases are fixed as well - but advices are broken :-(

#+begin_src emacs-lisp
(defun f (x)
  (interactive "P")
  (message "c-i: %s" (called-interactively-p 'any)))

(advice-add 'f :around (defun my-f--around-ad (f &rest args) (apply f args)))

(global-set-key [print] #'f)
#+end_src

Hitting [print] says nil.  AFAIU this should also work transparently,
right?  The breakage seems to date further back in this case.


And i have another request: could you please search for the few other
occurrences of the symbol 'closure' in the Emacs Elisp code base?  I
guess in most cases there is a need to update these places, too.


Regards,

Michael.




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

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


Received: (at 71934) by debbugs.gnu.org; 4 Jul 2024 15:48:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 04 11:48:24 2024
Received: from localhost ([127.0.0.1]:42792 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPOh6-0005V6-0F
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 11:48:24 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sPOh4-0005Uu-Qx
 for 71934 <at> debbugs.gnu.org; Thu, 04 Jul 2024 11:48:23 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 276D780A4B;
 Thu,  4 Jul 2024 11:48:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720108092;
 bh=EXcwnhTOG5Z+Jxt309ekmggxjqsmhlUAsSDEntkh0Kw=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=lkJ0HXhWvCY7Nxcm1L7SRoZzSTQiLZOpB58le/6xG79CXJTHgjs3mdj0/IqCnTM2u
 yzNBK9P+6pDdfntMZhZCkeirmthnp6czp63s/3NEJ5wm4KoH7VxePPNlsFdeQ0Z4mL
 uVJCf7tbGXLahVofcU5pcLp9N5dwvlznLPPGXZ5Onp4+Cf95np19I1LZPBAR8VRhq5
 /jHoOB0VBEktdRRIWpvoXq3A+hko1FpeXWd64Ws6qfM4udTs9Uo5s3LXW5w6edIKiG
 8pOXj44QUIs63KRVWf7y7tKjGylX17s0fp1wo85CPqqlF1zcM4afSnQ6giUuXwX8K2
 cLiGn7hST0McA==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C0768802A8;
 Thu,  4 Jul 2024 11:48:12 -0400 (EDT)
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B2D9E12034B;
 Thu,  4 Jul 2024 11:48:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <jwv34opfhbc.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Thu, 04 Jul 2024 09:08:44 -0400")
Message-ID: <jwvjzi12m7z.fsf-monnier+emacs@HIDDEN>
References: <877ce17ncn.fsf@HIDDEN> <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
Date: Thu, 04 Jul 2024 11:47:58 -0400
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.100 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: 71934 <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 (---)

>> AFAIU we must update this test in `edebug--called-interactively-skip':
>>
>> #+begin_src emacs-lisp
>>   (when (and (memq (car-safe (nth 1 frame1)) '(lambda closure)) ...
>> #+end_src

I pushed a patch to `emacs-30` which should fix this.
Can you confirm it fixes it in your real use case as well?


        Stefan





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

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


Received: (at 71934) by debbugs.gnu.org; 4 Jul 2024 13:08:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 04 09:08:58 2024
Received: from localhost ([127.0.0.1]:41780 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPMCn-0000YK-QN
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 09:08:58 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60114)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1sPMCl-0000Y6-UF
 for 71934 <at> debbugs.gnu.org; Thu, 04 Jul 2024 09:08:56 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E5CAE441A64;
 Thu,  4 Jul 2024 09:08:46 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1720098525;
 bh=P7qUHFd0eu5PZu1JgVegfRzVJbBHIlLqrHWg4LDBFdY=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=dFg1kGDZ1NGuQttRpRk1abVycZldG+CMdrIpVLsKUb9a3RQUpQZHjS5SXw+h/EPKp
 gmTNn4qqoqLgslEhHzTVpqHS9BQh4QLTHbrKCQUa40nq7WyNFV004nPJ2VfZ7gHcRJ
 uxd/NIjreuAp0LnD9QvRDf2cyyM5lHurK0DUi43E6seSu7URr4i/Zz7mkIrVgxycYZ
 W+uZo9qelYq0qFDAZ3HqsEl+ssoNeZRK6JRQ3MmQpU1We79i2E75SS/jC48sgDq58a
 MspGHCho5BRLq9KKWLSp2KWymxtfrK3xUHd5gZCGdvs+HZfW6gLqLI4cDjuhh1r8t4
 BexTiSnPi0gEw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5FE784419D0;
 Thu,  4 Jul 2024 09:08:45 -0400 (EDT)
Received: from pastel (unknown [45.72.245.253])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3945712025D;
 Thu,  4 Jul 2024 09:08:45 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new
 fun objects
In-Reply-To: <877ce17ncn.fsf@HIDDEN> (Michael Heerdegen's message of "Thu, 04
 Jul 2024 07:11:36 +0200")
Message-ID: <jwv34opfhbc.fsf-monnier+emacs@HIDDEN>
References: <877ce17ncn.fsf@HIDDEN>
Date: Thu, 04 Jul 2024 09:08:44 -0400
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.531 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 71934
Cc: 71934 <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 (---)

> AFAIU we must update this test in `edebug--called-interactively-skip':
>
> #+begin_src emacs-lisp
>   (when (and (memq (car-safe (nth 1 frame1)) '(lambda closure)) ...
> #+end_src

Indeed, thanks!


        Stefan





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

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


Received: (at submit) by debbugs.gnu.org; 4 Jul 2024 05:11:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 04 01:11:13 2024
Received: from localhost ([127.0.0.1]:41228 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sPEkS-0001OY-Sd
	for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 01:11:13 -0400
Received: from lists.gnu.org ([209.51.188.17]:45064)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1sPEkQ-0001OQ-KH
 for submit <at> debbugs.gnu.org; Thu, 04 Jul 2024 01:11:11 -0400
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 <michael_heerdegen@HIDDEN>)
 id 1sPEkN-0002lO-Cd
 for bug-gnu-emacs@HIDDEN; Thu, 04 Jul 2024 01:11:07 -0400
Received: from mout.web.de ([212.227.17.11])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1sPEk8-0008KI-IP
 for bug-gnu-emacs@HIDDEN; Thu, 04 Jul 2024 01:10:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1720069845; x=1720674645;
 i=michael_heerdegen@HIDDEN;
 bh=E+uy32PeiEPJxZamysdcQnutegFRwcaIEI9LFyQBAJU=;
 h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version:
 Content-Type:cc:content-transfer-encoding:content-type:date:from:
 message-id:mime-version:reply-to:subject:to;
 b=t2eEapIP+FWlo1Fi7bbjOAgtSrPSMVXuFei84PqwtmN8GlRfBNyNaQvUuvfGDNyT
 1AN67vchLObR8YHgCaywE0H9cDAzJSm4O1hJjifVA9Syk99H7lL5SNGDqluR++sAb
 TdlIZG4B/EG3cH3Q/plgWHfjjpOBQHr0Q7BqgZKfbwLkQyLhPHULZ0GNlOqjwfpe8
 rQznaEW4Iha9p4vIToF5+sjmxTOl+ugj4vMkNyaVgW7YWulga1YkqMl8DvCNzgCIr
 Bp4fxOq+8uvn7uQQe/l5V/zbIjYYf9hjwwk7FQNA9Ujghms0sFEXawhWlk930CNf/
 HmWMmyohnhqts74AFw==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([84.59.210.113]) by smtp.web.de (mrweb106
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N14tM-1sIFQ63xXO-00rgqW for
 <bug-gnu-emacs@HIDDEN>; Thu, 04 Jul 2024 07:10:45 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; edebug--called-interactively-skip vs. new fun objects
X-Debbugs-Cc: Stefan Monnier <monnier@HIDDEN>
Date: Thu, 04 Jul 2024 07:11:36 +0200
Message-ID: <877ce17ncn.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:aLG90b9C1XySqNB4tWWfeFRuKo2yQx3nOtybpAo1aZzxPxZsxV2
 X8vnemc4ZM8mhEf4sQwbgpYIuGA1lSNPZALeI7riq6ZzWwTovOqa16c4TvYk0J61dFV/2sB
 uvGJ7yZsvav4m1wmNSBBpq/sH40LczV1GywLKK7DH6m5irPkgUDscp0dyji7mBsb4doqea4
 2T5562UxCpdAZMbimDyAw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:QzaExG7ch0c=;kRAUV7MZQgDKa6sNkeTq7u/Wk8A
 YDV90o4HZxYlc/Zqc9Zj89sv7cAcUi+nxgWa2x6GQcGHGNZ+7KMln4pJGpudSOQRqOHjjlOln
 BF4FxTWq8vaT3eZHZtDJL1Mf9M19qacwlK/JeOmXqs2SxR69fzIHTGQOqGyOUtmC39uxBiaPr
 COLgx427wjpc1aqIP0hcOWnljazvv0BRAPbmIQ91JE0OlcKVC//hlr5Gm/oMVP8hKhuSJr9RL
 HLFgDl8PpAc8SCeYmgWQQBDs2iRyGh01wLm6aJyMF+Ebp7yuANy7WeIuqI4ueUWSgXkpMwJHu
 IunC40UpSQzd9ppGCuBb8yvgrnLIDaO7z0Zq1c4MSDwunC02Jp/dTmkEEbrIAtM7RnOgddJXU
 bjLJU32hiMoaYbgfF+jPoZurj/i4yNyyKb4BSnmuh0x+YxQkqjXNpBL5rTxH1DPFTU9lZsdGI
 VucLgSsdIvIhKIHrd9EnhNkOMC7gMn/oLf1o76/XSEUO8HhoX1eTQ9g3l63GxI/7LhRpJRK3M
 NLheDWVmidthQnMTOnumIeDfTthBW91r9qYXeDvjOJmsJEY38NMPXNS9rIIJMGi+D6O4CH5Lb
 wiQI0lnVBvAuz+0oM17cm0mmyn6lFagbdHlzdbucYK1ZR4wDxHUWX7WFxldudRSOIGPxRCQnn
 9OpMjxhFYJq2/PCmN9vVyxUjLr0Rf61i6t28dntiNx0c2C2jA9zwkBA3z4ezjHqegu2y0NXD+
 ZpPpiRzrJMAR7PZbFqBQeOPIJCKPoUqlKYxMdBNc2S665pAZaIel5yWhuXZzeYA3UmymhKw1m
 K6y4gFw5Ahm24WXlzMoXojqrH4+GdlTK8FpHF+JJZY6kQ=
Received-SPF: pass client-ip=212.227.17.11;
 envelope-from=michael_heerdegen@HIDDEN; helo=mout.web.de
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001,
 T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no
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 (--)


Hi,

AFAIU we must update this test in `edebug--called-interactively-skip':

#+begin_src emacs-lisp
  (when (and (memq (car-safe (nth 1 frame1)) '(lambda closure)) ...
#+end_src


My test case:

#+begin_src emacs-lisp
(defun f (x)
  (interactive "P")
  (message "c-i: %s" (called-interactively-p 'any)))
(global-set-key [print] #'f)
#+end_src

When edebugging `f', (called-interactively-p 'any) will eval to nil in
current master when hitting print.  Evalled to t as expected in older
Emacs versions.


TIA,

Michael.







Acknowledgement sent to Michael Heerdegen <michael_heerdegen@HIDDEN>:
New bug report received and forwarded. Copy sent to monnier@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to monnier@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#71934; 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, 10 Jul 2024 11:30:02 UTC

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