GNU bug report logs - #51695
29.0.50; lexical scope closure, interactive spec byte compiler warnings/usage issue

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: Emanuel Berg <moasenwood@HIDDEN>; dated Mon, 8 Nov 2021 23:41:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at submit) by debbugs.gnu.org; 11 Nov 2021 04:14:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 23:14:25 2021
Received: from localhost ([127.0.0.1]:39757 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ml1Tl-0001SZ-0a
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 23:14:25 -0500
Received: from lists.gnu.org ([209.51.188.17]:52318)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1ml1Th-0001SK-P9
 for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 23:14:23 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56966)
 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 1ml1Th-0007mo-L1
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 23:14:21 -0500
Received: from mout.web.de ([212.227.17.12]:50887)
 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 1ml1Tg-0006Xp-0j
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 23:14:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1636604058;
 bh=076oOtKwfTkSXhSUhMtWz+dN44xGvymoFPcVvslktvk=;
 h=X-UI-Sender-Class:From:To:Subject:References:Date:In-Reply-To;
 b=Aln4Is2qZteMrmjytgFJ8W7CpTos5hZ5LOivFLMZjzfiak/I2HH1PCB9iBIt3PgPq
 OSg78twJehnD6V8JzhT/bwKsDLKjOv2COWPtj58RRP1UxoAVIYwv8ypj6vcVKRMuBC
 r/dnBE4dk+Reka3FcplN/J0RwcG3Fok8Vhv/MjDc=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([92.208.225.87]) by smtp.web.de (mrweb106
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N2BM4-1mZR9L3a62-013pV2; Thu, 11
 Nov 2021 05:14:17 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#51695: 29.0.50; lexical scope closure, interactive spec
 byte compiler warnings/usage issue
References: <87k0hi2p3i.fsf@HIDDEN> <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
 <87bl2sdhxo.fsf@HIDDEN> <875yt022yw.fsf@HIDDEN>
 <87r1bozlzu.fsf@HIDDEN> <877ddfzid2.fsf@HIDDEN>
 <875ysztq0t.fsf@HIDDEN>
Date: Thu, 11 Nov 2021 05:14:16 +0100
In-Reply-To: <875ysztq0t.fsf@HIDDEN> (Emanuel Berg via's message of "Thu, 11
 Nov 2021 02:55:14 +0100")
Message-ID: <87ilwzxraf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:wYZAc8y5YBq6/55RQvx3tvIAmr/IK6B6eWJskTRTo4Wf8kCkNEq
 cDidbvwJNXMcntUJVByWJpvz5Tmw6O3LZkz8XwROfYnm1qQMFKlf7zpWuivYCKkTPMKE2I0
 igiDl8pu+fIBCJfgCedMvm801w5zyr3XKxGXUMOcrwag4hgjhfYDA/aRFXijkcRKXDUBudW
 M3tO6JhHIB4LERXFD3MCw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:MgoTq3795vI=:Ji38dBBpPOC2ldfznha64B
 9KdIOSvM55vhhs+1hgZQfCSAZt0GWVP+Ysmwwx1jDmts9jTy+vcMJXFBmDZq5Wse4xToJeH7S
 VL+fHl3kvFJ5pAvOZjbWnqq1QRa2vnJvnW4k9BBKvSRnLtrFrN59w7UesDUA2lZokLDaAw9xM
 lqiQoxQS675d3aMDDHUjIXNbOGjFVPEECz8qyFaBtWXJrmgAZLktNwcTErEL9twn1E6xwmGLd
 1ejTm469CKbUE4QC4VdUYku26OiEkB8tQVysECjkgUjSRV9W3gKG4Oig/x9DG96VCJjudae63
 nObdj+nY65CJ/CFaEeBEKRJRrbIV5SHnxPJuYk1C5CrKj8xCM5FT6wA0OFz0f8vq8XBPW1T8+
 zHEH+2qe2ORofRRntn/cx4ixxDUtloiHXITzQ/0v8ec/5f/pQCnyuKTPeN5zpuvqpljSfE/0m
 W+ua5UXq9t1f0G2e1hJHn+Fn0NBzdhJRCQr+xKyrIfUMnVmd94FJYiYP6d8KTBDK2I4IGlUxf
 WLm4ECGjjnXjPIWc0THEXs2T/6nyUOOOEo478qQNrdJWJW2XDyi9XNzkntkGCSVt1uvl3XXhl
 PYIZWJpsCc9XckE0HJWmRXra3b76M/+wW0+Hc3dAhWk+trkHXuXRQulpqSlB16cbo61Qb1L8f
 dhzWpsccVIfQ5qrs7gdntJRKtvOTMEFsOUoWs2o9ekZ8ggxdw44zTIDV32TuuovksiqmyKXJm
 IH5xOQbSLW7hzU79kFz7GqphyLS/niwuSpLv8ncfKL2qk3PMiE2iNor2/x+Lkh1WDJqf2teRY
 gPKoJvEdj9XLY97WeAU2pI3co9WoXKHi8XBXqKIBf0VBg3y2BIUHPVPgnIp8fI+iCXXsRv5l+
 zg4sfBFpdruhzfa6qmDqDcvjZ0RHO+wYTybMgxoFDX9/FWJfoURK6gaCdWPTzpUvhX69YgYJ5
 K3mMHZJnOpvO+Wn5oeFvq6g8NFfX2zd22URU6jMD607EAW9Tt8DgtYMXit8zGYw9tNNOAgoL4
 1RnU/kJT8yxjkNIJFN+XTvXlhPjuoSMyairAMNErlZpqzS8n4eH6MtGbEJrFxseRIKeF+a5kB
 C+Cg7FQBSWowmI=
Received-SPF: pass client-ip=212.227.17.12;
 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_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
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.4 (--)

Emanuel Berg via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@HIDDEN> writes:

> It make sense that it works with `lambda' as well but how does that
> emphasize it more you mean?

As I said, it is irrelevant.  I just don't feel well to see a `defun'
not being a top-level expression.  I feel better doing such low-level
stuff with the low-level tools.  Please ignore it.

Michael.




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

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


Received: (at submit) by debbugs.gnu.org; 11 Nov 2021 01:55:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 20:55:34 2021
Received: from localhost ([127.0.0.1]:39581 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkzJO-0003c8-D7
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 20:55:34 -0500
Received: from lists.gnu.org ([209.51.188.17]:50682)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkzJL-0003bx-1g
 for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 20:55:32 -0500
Received: from eggs.gnu.org ([209.51.188.92]:57440)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkzJK-0006PS-9k
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 20:55:30 -0500
Received: from ciao.gmane.io ([116.202.254.214]:59808)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkzJI-0004BO-QL
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 20:55:30 -0500
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkzJD-0007kl-3o
 for bug-gnu-emacs@HIDDEN; Thu, 11 Nov 2021 02:55:23 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-gnu-emacs@HIDDEN
To: bug-gnu-emacs@HIDDEN
From: Emanuel Berg <moasenwood@HIDDEN>
Subject: Re: bug#51695: 29.0.50;
 lexical scope closure, interactive spec byte compiler warnings/usage
 issue
Date: Thu, 11 Nov 2021 02:55:14 +0100
Message-ID: <875ysztq0t.fsf@HIDDEN>
References: <87k0hi2p3i.fsf@HIDDEN> <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
 <87bl2sdhxo.fsf@HIDDEN> <875yt022yw.fsf@HIDDEN> <87r1bozlzu.fsf@HIDDEN>
 <877ddfzid2.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:HxWEUKljk+4tStjpatoMsHapNcU=
Mail-Copies-To: never
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
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.1 (--)

Michael Heerdegen wrote:

> I use `defalias' with the "naked" lambda to emphasize that
> it's important here that a closure is involved

Okay, how so?

I heard `let' en"closing" a `defun' was the closure ...

It make sense that it works with `lambda' as well but how does
that emphasize it more you mean?

-- 
underground experts united
https://dataswamp.org/~incal





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

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


Received: (at submit) by debbugs.gnu.org; 10 Nov 2021 23:44:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 18:44:21 2021
Received: from localhost ([127.0.0.1]:39438 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkxGP-0005ot-Cb
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 18:44:21 -0500
Received: from lists.gnu.org ([209.51.188.17]:55752)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1mkxGK-0005oh-NU
 for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 18:44:19 -0500
Received: from eggs.gnu.org ([209.51.188.92]:34032)
 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 1mkxGK-0001WQ-Gr
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 18:44:16 -0500
Received: from mout.web.de ([212.227.15.3]:39845)
 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 1mkxGH-0004C9-Of
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 18:44:16 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1636587850;
 bh=g8MlnsqYXp0SD1qUcjShVuPBnrPJ+0/LNuEYLW7JBYs=;
 h=X-UI-Sender-Class:From:To:Subject:References:Date:In-Reply-To;
 b=MTiRL7kpLyN2p/fp/7M42vOBJzpuob3GBXht4K/oC80L2OlHrnuwXHZBt5ZHHFnEZ
 LiON0i8sGL7FWswmCdexNfNQ2GOvcEDoVyvfUDUqViZUk2rVDU/bu0HuYN6Mp4E5eG
 j0VVdCPVkeV3I2cSBYD2sTis6ruFzVx41C3LWekg=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([92.208.225.87]) by smtp.web.de (mrweb006
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1M28SL-1mj1Jj1rsf-002M8M; Thu, 11
 Nov 2021 00:44:10 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Re: bug#51695: 29.0.50; lexical scope closure, interactive spec
 byte compiler warnings/usage issue
References: <87k0hi2p3i.fsf@HIDDEN> <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
 <87bl2sdhxo.fsf@HIDDEN> <875yt022yw.fsf@HIDDEN>
 <87r1bozlzu.fsf@HIDDEN>
Date: Thu, 11 Nov 2021 00:44:09 +0100
In-Reply-To: <87r1bozlzu.fsf@HIDDEN> (Emanuel Berg via's message of "Wed, 10
 Nov 2021 05:13:25 +0100")
Message-ID: <877ddfzid2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:ZoLh1XlG0t5eFgnkIm/1ZlsV+l5Q+2gBY29Zjzd31ic1KyJuJRQ
 9coUsoKdyDqWJpe4Tww2WXi4Em+R5WqlDtuL8dUwzlj5S0luRrjsqsPFUADlQFBAFfQ3V//
 nXV8W2Sk0NyrQCT1v06Wxan8cFAELVecGKsoFuYbRUkOAjdu1T9I3+A8FBmnGNOxH8I3YCu
 B4lVwSRzlpu9W4Fjg4ZcQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:CZ+zUPbMXaY=:0Ldl0GcdhdoFU+iV73xWQy
 wNQJ/9Z0lWbGR8DGY6ZAeNYZFGk5YkrPxUCtMFFLtk2qsxoNUM9Ktp7wEyNqe7dwGF7L7noEG
 jBASeJ2OxthK60vqGw12zJwSoG40LiBgYUE/27EjjwOUj0k8ir0Ci3+EwksiLANGaeamybJqE
 baNPiGoGyMkHUYVITAqHN52r0Nl3kUihZ4SE1xG9rT1Zm0btVow6lrI2PrWz6n1sgMBpUXkc3
 6LJrcSszbJHSZeaLCyOGZOed1RBainYIKkRvy10E1km6ymTkszYA19f8WcBxoBPAJ0DO/jPoq
 8JeevWFDQhcC2JiYCTjxG6F7boKHJnNieNhk9So1xWkrcJ/2tqvRq4oCEiKS9+2iXWTblr5MS
 AsHlRYTyqVRHh1bs5F3JoCEoVXU6y4fX+GQeOvDclKnD2Cwnq6Nxaj4rFbqKOVY97h12gT2xR
 W2CVVSdop2tUD9VlyvrpklHDEmQmEUSqfuMiQ3M5NQEKeogSic2wIx3Hkpiyrk9pi8/BtWiGt
 syEjMM7oG+KBMna7X+oNRBrExRmPzxwR3+uBqEtfd2WZy1qeCoWGaCiWibdpEVSremZ+O3fAo
 k3vnO+hG1KNFvuTGbzvTjETCQSkx6y6UeG8rU9oz+fthUwaL5vRJDa78vnJZ7OXI0sknesRVw
 Jmz9pGoEURjFqwTttrF5GyfK57okQzqVpg8Sw60YTS2VjrzQ3DujUGyZD14zthEYIfyXBmWae
 pyfV2ObA7MbBqesN8wpx9Nr1zROR2ioUXf7liLA6a8cNOTSXN1LDLZ48K8P5rQTUsQ/n8BJlY
 ywQdnc5D/v8IdkQ2kIUFWtmTMaGtviP2Lwyr31cPIsOptRUrxhLnq9NKc0BaUlx15IiVqkrhv
 IJEyO7sW+2Si3h9K3ho4M14qGeMYvrljz0DL3o8UAlROWdaDVwAiXSG8b9RhJpG87J3FHm1nk
 BQSUSVkdqG6NizEP7hSkCWp04ZFL3p8nik0xUoJubDGc9AcusQbw6edDQ4wzAnKqTO4TYjfiQ
 R9m8J6dz7kDsd+YH8/2xaxOuFvFvQeHRzNwGt94AxkgLWIhkWc9qoexJOrZqNz5MPxVAwXPPK
 0aQ/dZJROHsfao=
Received-SPF: pass client-ip=212.227.15.3;
 envelope-from=michael_heerdegen@HIDDEN; helo=mout.web.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
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.4 (--)

Emanuel Berg via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@HIDDEN> writes:

> `defalias' and `lambda' BTW, isn't that an anonymous function
> with a name ... maybe an ordinary function makes more sense
> there, especially since `declare-function' has to be used?
>
> Or why a lambda?

Any `defun' call expands into a defalias form (plus optional
declarations).  It's a matter of taste what to use in this case - I use
`defalias' with the "naked" lambda to emphasize that it's important here
that a closure is involved, but that's irrelevant, you can do as
you wish.

Michael.




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

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


Received: (at 51695) by debbugs.gnu.org; 10 Nov 2021 13:20:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 10 08:20:25 2021
Received: from localhost ([127.0.0.1]:37323 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mknWb-0005rO-6l
	for submit <at> debbugs.gnu.org; Wed, 10 Nov 2021 08:20:25 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56092)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mknWY-0005r8-Ud
 for 51695 <at> debbugs.gnu.org; Wed, 10 Nov 2021 08:20:24 -0500
Received: from [2001:470:142:3::e] (port=58086 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mknWR-0000Q0-Dl; Wed, 10 Nov 2021 08:20:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vfnuj8RK4Es5qy09f2XL3bp8hX68xH5tHAZDsq7f9II=; b=IUZiryl/4deE
 /Fg8n7I3Hk1hAj5oX+lY8urk5UxVc0i/4BWvfRaH7FyU7HlgsWVmozZXmGHN/EfA6oirMLKxdBf+h
 pYysm2urbu/jooKVAUFtIf8Sos28wlEL/7L9inhMXZPJNupLg1TKaj72h2MqQKeHNzu7KSi5FXTwO
 spmFYAROUQjxvn0W3Uf2jdpohhFwRrJqaxHJVsmEZ2AtSwaOlFjkZXn/5vBgv0qVxDgwM+CXjMKHR
 l9ygQbe0zaJaAipmKDZWraWNoz8HU0sImEckVaFs4N4AfDhHLllGPLES8PE+e5dY8V50SNI0HQVIl
 aeSPHkizQ0/paylm76I5Wg==;
Received: from [87.69.77.57] (port=2545 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mknWQ-0008TS-E3; Wed, 10 Nov 2021 08:20:15 -0500
Date: Wed, 10 Nov 2021 15:20:08 +0200
Message-Id: <837ddg406v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Emanuel Berg <moasenwood@HIDDEN>
In-Reply-To: <87a6ic23ie.fsf@HIDDEN> (message from Emanuel Berg on Wed, 10
 Nov 2021 02:39:05 +0100)
Subject: Re: bug#51695: 29.0.50; lexical scope closure, interactive spec
 byte compiler warnings/usage issue
References: <87k0hi2p3i.fsf@HIDDEN> <83r1bp5x6h.fsf@HIDDEN>
 <87a6ic23ie.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51695
Cc: 51695 <at> debbugs.gnu.org, 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 (---)

> From: Emanuel Berg <moasenwood@HIDDEN>
> Cc: 51695 <at> debbugs.gnu.org,  monnier@HIDDEN
> Date: Wed, 10 Nov 2021 02:39:05 +0100
> 
> > How can the interactive spec use lexically-bound variables
> > outside its scope, when the interactive spec runs not at
> > function definition time, but at function invocation time,
> > when those variables will be long gone?
> 
> But it does work if you evaluate the code, isn't this
> discrepancy a problem?

Not for me, it isn't.  But what do I know?

> "Function definition time", is that the time of Elisp
> evaluation, byte compilation, or the loading of byte-compiled
> source BTW?

Whenever the function definition is evaluated, yes.




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

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


Received: (at submit) by debbugs.gnu.org; 10 Nov 2021 04:13:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 23:13:47 2021
Received: from localhost ([127.0.0.1]:36568 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkezb-0007Ck-9C
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:13:47 -0500
Received: from lists.gnu.org ([209.51.188.17]:59282)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkezX-0007CR-HX
 for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 23:13:46 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35282)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkezX-0001Jr-DE
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 23:13:43 -0500
Received: from ciao.gmane.io ([116.202.254.214]:58034)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkezR-00009e-Oa
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 23:13:43 -0500
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkezP-0006JP-92
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 05:13:35 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-gnu-emacs@HIDDEN
To: bug-gnu-emacs@HIDDEN
From: Emanuel Berg <moasenwood@HIDDEN>
Subject: Re: bug#51695: 29.0.50;
 lexical scope closure, interactive spec byte compiler warnings/usage
 issue
Date: Wed, 10 Nov 2021 05:13:25 +0100
Message-ID: <87r1bozlzu.fsf@HIDDEN>
References: <87k0hi2p3i.fsf@HIDDEN> <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
 <87bl2sdhxo.fsf@HIDDEN> <875yt022yw.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:Xh/0Ic9m+Oz9mylJmC27nAS/22Y=
Mail-Copies-To: never
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
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.1 (--)

>> #+begin_src emacs-lisp
>> (let* ((data-item 1)
>>        (more-data 2))
>>   (defalias 'echo-data--interactive
>>     (lambda ()
>>       (list (read-number "number: " (or data-item more-data)))))
>>   (declare-function echo-data--interactive test) ;defun was not top-level
>>   (defun echo-data (&optional data)
>>     (interactive (echo-data--interactive))
>>     (message "data: %s" (or data data-item)) ))
>> #+end_src
>
> Thanks, I wrote this to illustrate the situation but
> interesting nonetheless, I don't think I've seen `defalias'
> to a `lambda' before and also didn't think of putting
> `declare-function' within the `let' body ... practical.

It works.

Both the aliases and the functions have to be
`declare-function'ed for the byte compiler.

`defalias' and `lambda' BTW, isn't that an anonymous function
with a name ... maybe an ordinary function makes more sense
there, especially since `declare-function' has to be used?

Or why a lambda?

-- 
underground experts united
https://dataswamp.org/~incal





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

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


Received: (at submit) by debbugs.gnu.org; 10 Nov 2021 01:55:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 20:55:11 2021
Received: from localhost ([127.0.0.1]:36407 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkcpT-0001Nq-G4
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 20:55:11 -0500
Received: from lists.gnu.org ([209.51.188.17]:45010)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkcpQ-0001Nf-Oa
 for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 20:55:09 -0500
Received: from eggs.gnu.org ([209.51.188.92]:36084)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkcpO-00057T-QT
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 20:55:08 -0500
Received: from ciao.gmane.io ([116.202.254.214]:52008)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkcpM-0000YF-Oa
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 20:55:06 -0500
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkcpJ-00083x-LA
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 02:55:01 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-gnu-emacs@HIDDEN
To: bug-gnu-emacs@HIDDEN
From: Emanuel Berg <moasenwood@HIDDEN>
Subject: Re: bug#51695: 29.0.50;
 lexical scope closure, interactive spec byte compiler warnings/usage
 issue
Date: Wed, 10 Nov 2021 02:54:20 +0100
Message-ID: <871r3o22sz.fsf@HIDDEN>
References: <87k0hi2p3i.fsf@HIDDEN> <83r1bp5x6h.fsf@HIDDEN>
 <87a6ic23ie.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:MDbbilMNTVMzsYXGrgAKtZ4fcGE=
Mail-Copies-To: never
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
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.1 (--)

> Also it would be preferable/intuitive if one could use
> closures so that the variable is available everywhere where
> it is spelled-out in the `let' form body ... Now we have
> seen that this isn't the case for `interactive' so then one
> has to wonder, where else isn't it available?

That's right ... bad in two senses of it.

> PS. I looked in gmane.emacs.bugs but couldn't find this bug
>     there ... maybe now it will appear? If not we can have
>     the disucssion at gmane.emacs.help instead since that
>     will involve more people, probably.

Nevermind, found it :)

-- 
underground experts united
https://dataswamp.org/~incal





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

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


Received: (at submit) by debbugs.gnu.org; 10 Nov 2021 01:51:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 20:51:06 2021
Received: from localhost ([127.0.0.1]:36402 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkclV-0001HT-Vc
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 20:51:06 -0500
Received: from lists.gnu.org ([209.51.188.17]:44368)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkclT-0001HK-In
 for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 20:51:04 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35452)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkclT-0004TR-82
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 20:51:03 -0500
Received: from ciao.gmane.io ([116.202.254.214]:38392)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkclQ-0007M4-4K
 for bug-gnu-emacs@HIDDEN; Tue, 09 Nov 2021 20:51:02 -0500
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mkclM-0003Fg-Qh
 for bug-gnu-emacs@HIDDEN; Wed, 10 Nov 2021 02:50:56 +0100
X-Injected-Via-Gmane: http://gmane.org/
Mail-Followup-To: bug-gnu-emacs@HIDDEN
To: bug-gnu-emacs@HIDDEN
From: Emanuel Berg <moasenwood@HIDDEN>
Subject: Re: bug#51695: 29.0.50;
 lexical scope closure, interactive spec byte compiler warnings/usage
 issue
Date: Wed, 10 Nov 2021 02:50:47 +0100
Message-ID: <875yt022yw.fsf@HIDDEN>
References: <87k0hi2p3i.fsf@HIDDEN> <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
 <87bl2sdhxo.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cancel-Lock: sha1:60LXAQFPhgvkUunuwDBW72eRfN4=
Mail-Copies-To: never
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: -16
X-Spam_score: -1.7
X-Spam_bar: -
X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
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.1 (--)

Michael Heerdegen wrote:

> Since one seems to need to make use of the global
> environment at some point, I suggest to use a named function
> as workaround, like in
>
> #+begin_src emacs-lisp
> (let* ((data-item 1)
>        (more-data 2))
>   (defalias 'echo-data--interactive
>     (lambda ()
>       (list (read-number "number: " (or data-item more-data)))))
>   (declare-function echo-data--interactive test) ;defun was not top-level
>   (defun echo-data (&optional data)
>     (interactive (echo-data--interactive))
>     (message "data: %s" (or data data-item)) ))
> #+end_src

Thanks, I wrote this to illustrate the situation but
interesting nonetheless, I don't think I've seen `defalias' to
a `lambda' before and also didn't think of putting
`declare-function' within the `let' body ... practical.

-- 
underground experts united
https://dataswamp.org/~incal





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

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


Received: (at 51695) by debbugs.gnu.org; 10 Nov 2021 01:39:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 20:39:18 2021
Received: from localhost ([127.0.0.1]:36395 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkca6-0000wU-Ci
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 20:39:18 -0500
Received: from sender11-pp-o91.zoho.eu ([185.20.211.249]:25264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <moasenwood@HIDDEN>) id 1mkca4-0000wG-9w
 for 51695 <at> debbugs.gnu.org; Tue, 09 Nov 2021 20:39:17 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1636508347; cv=none; d=zohomail.eu; s=zohoarc; 
 b=SqLyB2UejKpA6EGAS8ZCi2xWq3u9dbJ00/BnxIK03Wo0EpgfMYFTkwurAB+Fqq5EoMYoUTL119T79CEB8Pn0pCETQQbdV/OocqI3bktEaT+t8l4STthi1I+E+Obq9/3fNzjSBeTARccV0Fm33vShrnzDX6wAv6JHDUt28rZFTYA=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu;
 s=zohoarc; t=1636508347;
 h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To;
 bh=X42ebgsC6H1s0ol9u5mpJvUgyCncFPjLo+qIKJaYzF8=; 
 b=UDK310JFrHFB1fMNXr01hKG41kXez715CPBuqiIfU5P37Sl1lcM2BV06EBtNwvABuJLwCbwHyeFKt3rYBBDWfHN49io5dSDnOCfyHb9L9MSqxa4BCcaM54DZ94yIQ25tAW30gwotwFCH4SlC/Z7Y01dN6VXhlzZzushvzWvrhIs=
ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass  header.i=zoho.eu;
 spf=pass  smtp.mailfrom=moasenwood@HIDDEN;
 dmarc=pass header.from=<moasenwood@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1636508347; 
 s=admin; d=zoho.eu; i=moasenwood@HIDDEN;
 h=From:To:Cc:Message-ID:Subject:References:Date:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding;
 bh=X42ebgsC6H1s0ol9u5mpJvUgyCncFPjLo+qIKJaYzF8=;
 b=Vpu1Fk98h+olfLwWgqq0lHbhGozA9a5XvnmTFujl+Vwqsd9NF6oivZKYjOADbTxz
 fPUmM72ps0vEw2IhxrHAl2r9x8kz2ZJCLD1fz7o/yT8zLfFHhMDfN2uJ9VVlxWfsznU
 EkErvzf77DTjoZlHWNoFBDXu95kqZY1Y5XPQ8OUQ=
Received: from ebih.zoho.eu (c-178e225c.021-67-7570702.bbcust.telenor.se
 [92.34.142.23]) by mx.zoho.eu
 with SMTPS id 1636508347256559.3490942888619;
 Wed, 10 Nov 2021 02:39:07 +0100 (CET)
From: Emanuel Berg <moasenwood@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <87a6ic23ie.fsf@HIDDEN>
Subject: Re: bug#51695: 29.0.50; lexical scope closure, interactive spec
 byte compiler warnings/usage issue
References: <87k0hi2p3i.fsf@HIDDEN> <83r1bp5x6h.fsf@HIDDEN>
Mail-Copies-To: never
Date: Wed, 10 Nov 2021 02:39:05 +0100
In-Reply-To: <83r1bp5x6h.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 09 Nov
 2021 14:29:58 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51695
Cc: 51695 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii wrote:

>> ;;; -*- lexical-binding: t -*-
>> ;;;
>> ;;; this file:
>> ;;;   http://user.it.uu.se/~embe8573/emacs-init/geh.el
>> ;;;   https://dataswamp.org/~incal/emacs-init/geh.el
>>=20
>> (let ((data-item 1)
>>       (more-data 2) )
>>     (defun echo-data (&optional data)
>>       (interactive (list (read-number "number: " (or data-item more-data=
))))
>>       (message "data: %s" (or data data-item)) ))
>> ;; (echo-data 5)
>> ;; (echo-data)
>> ;; (call-interactively #'echo-data)
>>=20
>> ;; Emacs bugs:
>> ;;
>> ;; 1. Byte compiler warnings (two cases) relating to the
>> ;;    interactive spec:
>> ;;
>> ;;    geh.el:7:1: Warning: Unused lexical variable `more-data'
>> ;;    geh.el:10:54: Warning: reference to free variable =E2=80=98data-it=
em=E2=80=99
>> ;;    geh.el:10:64: Warning: reference to free variable =E2=80=98more-da=
ta=E2=80=99
>> ;;
>> ;; 2. When the compiled version is used interactively:
>> ;;
>> ;;    Symbol's value as variable is void: data-item
>
> How can the interactive spec use lexically-bound variables
> outside its scope, when the interactive spec runs not at
> function definition time, but at function invocation time,
> when those variables will be long gone?

But it does work if you evaluate the code, isn't this
discrepancy a problem?

"Function definition time", is that the time of Elisp
evaluation, byte compilation, or the loading of byte-compiled
source BTW?

I always felt static/lexical scope was completely natural, so
for me personally it wasn't necessary, but the case I've heard
several times is that one can make out what happens just by
looking at the code. But here is a case when that's isn't
enough since the behavior will differ based on other factors,
as we have seen ...

Also it would be preferable/intuitive if one could use
closures so that the variable is available everywhere where it
is spelled-out in the `let' form body ... Now we have seen
that this isn't the case for `interactive' so then one has to
wonder, where else isn't it available?

PS. I looked in gmane.emacs.bugs but couldn't find this bug
    there ... maybe now it will appear? If not we can have the
    disucssion at gmane.emacs.help instead since that will
    involve more people, probably.

--=20
underground experts united
https://dataswamp.org/~incal





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

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


Received: (at 51695) by debbugs.gnu.org; 9 Nov 2021 23:32:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 18:32:13 2021
Received: from localhost ([127.0.0.1]:36198 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkab6-0007zr-QD
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 18:32:12 -0500
Received: from mout.web.de ([212.227.17.12]:59239)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1mkab4-0007zd-G9
 for 51695 <at> debbugs.gnu.org; Tue, 09 Nov 2021 18:32:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1636500724;
 bh=a+NvatW0YCSnGCYfB8rcZ3B+SAZw+9aO5zVbfPPaG6E=;
 h=X-UI-Sender-Class:From:To:Subject:References:Date:In-Reply-To;
 b=hJFe+ow/kq99Xxa9ChyzVKUK11LCNYCL95TaP0DE3BslQhsvB9XG2EPHpwypRL9hs
 UroXNNcpUTo7xRwYOrSdXEyzLtCLp4gU2BPZRV/L9+XqIiYSH4SCdFHuFrPsDh9GVY
 xR8MYlzTANjhwMkVn/Lg5jMkEO/CjBORfAp7jOw8=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([92.208.225.87]) by smtp.web.de (mrweb105
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MEUS0-1mv6J40v9e-00GSZR; Wed, 10
 Nov 2021 00:32:04 +0100
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: 51695 <at> debbugs.gnu.org
Subject: Re: bug#51695: 29.0.50; lexical scope closure, interactive spec
 byte compiler warnings/usage issue
References: <87k0hi2p3i.fsf@HIDDEN> <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
Date: Wed, 10 Nov 2021 00:32:03 +0100
In-Reply-To: <jwvilx11nqs.fsf-monnier+emacs@HIDDEN> (Stefan Monnier via's
 message of "Tue, 09 Nov 2021 08:14:03 -0500")
Message-ID: <87bl2sdhxo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:gQcsxa0khkuqApH4H+fkkkDbWmbqnRdSuREYw+tf108m0oweGxG
 AbR+kSPcSJexVKZ4972fogrSTEiznGhlbDWC8h9E9T+sQQjtvCkiiSwnfepMU2QwKHWJZ9C
 kKrPzoWpnQ6CGhLyR9k+RinXMbAfnt+n0g1obwVMdR0PsEeiw0U7Up7hgt+ktMiKHCFaHiQ
 sqnL1R2+0sfdShDUnIrBw==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:PqVHDuhLP74=:BloVd9fSI6skOFg20R2VJX
 IqRNoc9jawGXEBUTuwkC7hJWlTay3crItJNNHQISCi63cbbOrK7NJTgvzbaxoSYF5d7/UwU9j
 lKR4IHvdnrjqRo4pM+kNYVWglsLDDzYKIpB/z7UAM1q/bMge5PwnUQb/AYECQ255Pjo87QtHL
 L/cjWZ8hu/Eqy+idmZrsRrgDPq4eYCWmkOdFRuNanrE7coy0zUWBLHuozn0o0uRbqnO11c3CS
 UMT5q9Udqg5/OaY6ZP9EUSk3whUn4IZwewTlEO9GFEQCXPUWf2kgxjFFEOZLpfJ8hHlsi1CAs
 WCeI411HqK+rR4Tt87FaeT8J6yKQjUooZjzft8TVFAjXf79lg8DqFCLdC/yR6KoeVqSZNSF8v
 ReAvnx08+obM/MBmnj23qXdkuD7Ou3gGjqI7Y7MAjqjzbtXVB6y8SnsT3g9dT982ziU2OoG6Z
 8tr7ngzYcXghYG450HufMSKai/lleEH3HNoG0xZtaj8ahKL253BzbV9KRTR86Tx5o5XE9a/+R
 CP9GLhQCkBw7B+RPp3k0k0rXMH2Ccf4HTgWNRe5fH1/lsyfoRE1d1IB1LO91jbRCy6Q1mL0i+
 Ne3CVPCdY7UO2GyCXd8dS8A8MbIvFIVZXHsSIcNYRJTg7UJtXxY/N4JLl/T/s9imQHR+B/xXM
 XuABJ2/tWGYvCCsxKxiMl9FbwQY+5tCqn25cnrH0qw1aMnTeFNa+4VWHviyVNsDGvpQ2PvBKz
 CUvZleSgihCnw3UBm5mHstZdAn0sjBaBQ3My0GIe3CnX951tyh0M2rt1lokCR2PXeNDObzVBM
 vcK3bgykxEpeLUAoGEZcJqjdqVxKFHq0fuurieEimsIgzjUOPrETAxTVDhFfH0bD/2I9WLMgn
 2KFj6mocxXYNORIj7bRPvo3LJCNHAbifWheNpc2k2cQqIACBglgPNNtpS2MbeGrIjzdQ4UdY+
 Jd/sANm8N/Le5tDFuixsNFRlWQb+eMbzGUifckBToBKkPMKDOpCmrlS9KvxRZ/8DBck0zbZSd
 HuywtWSTlFjkuVp9TSpMU6ySoYauJsVNsb/pnysOI2jzcI41cDaKiKNS7cHfbAPRG1dI0nk4t
 R3nk//1iEvLshE=
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51695
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 via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@HIDDEN> writes:

> [...] so in the mean time I recommend you find some workaround

Since one seems to need to make use of the global environment at some
point, I suggest to use a named function as workaround, like in

#+begin_src emacs-lisp
(let* ((data-item 1)
       (more-data 2))
  (defalias 'echo-data--interactive
    (lambda ()
      (list (read-number "number: " (or data-item more-data)))))
  (declare-function echo-data--interactive test) ;defun was not top-level
  (defun echo-data (&optional data)
    (interactive (echo-data--interactive))
    (message "data: %s" (or data data-item)) ))
#+end_src

Michael




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

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


Received: (at 51695) by debbugs.gnu.org; 9 Nov 2021 13:14:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 08:14:23 2021
Received: from localhost ([127.0.0.1]:32927 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkQx9-0007nF-O4
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 08:14:23 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mkQx3-0007mv-T8
 for 51695 <at> debbugs.gnu.org; Tue, 09 Nov 2021 08:14:17 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 78FE68065D;
 Tue,  9 Nov 2021 08:14:07 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5DC4180152;
 Tue,  9 Nov 2021 08:14:05 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1636463645;
 bh=9LuAoQ4f+agfUBj7JdzgCaNm7MNC8XhElXvxN5vReB0=;
 h=From:To:Subject:References:Date:In-Reply-To:From;
 b=OnikkSip840g2UFZayt54CqbGIpsszFCQQx+aHSHqvhZQ5DjEg1v53RkeJDNEqyN5
 d01FsMq2q93NR3p5qxOOCBCv16FIZHj/k8Lh8MgzC6K+MEnVErJKC5muVncqLhLQi9
 ybBqcywQX/F4o0nbq/wzWwPbozKrxPcqSlyuh5k6Uej6FAfmgRVNCXfi46sKb3g1bM
 jba4A0WdF3zB3vs/e5EArCqBcCPLC1iYrcUAyvwftqq66pqebobA7tpbYp/hoA/waK
 +nL8gz9Wf1M1SGoYcwj1qYPnHOKo/0Fdr1qk1juts1UMMnyf+TNuP3zMCE4mrp0wpQ
 FMORTbEtp/ktA==
Received: from pastel (unknown [45.72.241.23])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1821D120169;
 Tue,  9 Nov 2021 08:14:05 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: 51695 <at> debbugs.gnu.org
Subject: Re: bug#51695: 29.0.50; lexical scope closure, interactive spec
 byte compiler warnings/usage issue
Message-ID: <jwvilx11nqs.fsf-monnier+emacs@HIDDEN>
References: <87k0hi2p3i.fsf@HIDDEN>
Date: Tue, 09 Nov 2021 08:14:03 -0500
In-Reply-To: <87k0hi2p3i.fsf@HIDDEN> (Emanuel Berg's message of "Tue, 09 Nov
 2021 00:40:33 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.062 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
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51695
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 (-)

> (this should sum it up but see thread on gmane.emacs.help for background,
> https://lists.gnu.org/archive/html/help-gnu-emacs/2021-11/msg00000.html
> . keep it real)
>
> ;;; -*- lexical-binding: t -*-
> ;;;
> ;;; this file:
> ;;;   http://user.it.uu.se/~embe8573/emacs-init/geh.el
> ;;;   https://dataswamp.org/~incal/emacs-init/geh.el
>
> (let ((data-item 1)
>       (more-data 2) )
>     (defun echo-data (&optional data)
>       (interactive (list (read-number "number: " (or data-item more-data)=
)))
>       (message "data: %s" (or data data-item)) ))
> ;; (echo-data 5)
> ;; (echo-data)
> ;; (call-interactively #'echo-data)
>
> ;; Emacs bugs:
> ;;
> ;; 1. Byte compiler warnings (two cases) relating to the
> ;;    interactive spec:
> ;;
> ;;    geh.el:7:1: Warning: Unused lexical variable `more-data'
> ;;    geh.el:10:54: Warning: reference to free variable =E2=80=98data-ite=
m=E2=80=99
> ;;    geh.el:10:64: Warning: reference to free variable =E2=80=98more-dat=
a=E2=80=99
> ;;
> ;; 2. When the compiled version is used interactively:
> ;;
> ;;    Symbol's value as variable is void: data-item

Thanks.  This is a limitation in `cconv.el` tho it will likely require
further changes in `bytecomp.el` and/or `callint.c`.

Not sure when I'll find the time to tackle it, so in the mean time
I recommend you find some workaround,


        Stefan





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

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


Received: (at 51695) by debbugs.gnu.org; 9 Nov 2021 12:30:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 09 07:30:18 2021
Received: from localhost ([127.0.0.1]:32849 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkQGX-0004e2-GC
	for submit <at> debbugs.gnu.org; Tue, 09 Nov 2021 07:30:17 -0500
Received: from eggs.gnu.org ([209.51.188.92]:39930)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mkQGR-0004R2-Vw
 for 51695 <at> debbugs.gnu.org; Tue, 09 Nov 2021 07:30:15 -0500
Received: from [2001:470:142:3::e] (port=36106 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkQGM-0008T5-4y; Tue, 09 Nov 2021 07:30:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Cr9a04lTzfAgDD81wE9rzFCpk8uLJ7m0ibmMxxgL9UE=; b=fuwB4TfsGdFcCs7xm1c1
 iZZkJWU+MyqzMiH23VemKKpDhENo74oBzeBFqhCcRRZGx9jdob574Largze4bznz8OhIubiLubfPv
 4lIj0ESUReO30NG+zVDozCDBtjj9ukq9iliLKMDZTo1Ldh/2+zpm499K8N/VIMCMZGpbt4TaBshoW
 6o/oE1JdVSPM8ojdqqlujImlgg1h90+ClxL6Ld6BInCQxptnPNna2z7mNv583T9hWfMlFOAhlsoMX
 YsAiRsdniAh4NBklU2wcoV1UzaCL6kAWWgpV5cgbwXg3osjVH9BXJQIK9dLpNxV0b+2FYkEEbTSK1
 4sj+x6F+BfRldQ==;
Received: from [87.69.77.57] (port=2203 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mkQGL-0007G3-NE; Tue, 09 Nov 2021 07:30:06 -0500
Date: Tue, 09 Nov 2021 14:29:58 +0200
Message-Id: <83r1bp5x6h.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Emanuel Berg <moasenwood@HIDDEN>
In-Reply-To: <87k0hi2p3i.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#51695: 29.0.50;
 lexical scope closure, interactive spec byte compiler warnings/usage
 issue
References: <87k0hi2p3i.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51695
Cc: 51695 <at> debbugs.gnu.org, 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 (---)

> Cc: Stefan Monnier <monnier@HIDDEN>
> Date: Tue, 09 Nov 2021 00:40:33 +0100
> From:  Emanuel Berg via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> ;;; -*- lexical-binding: t -*-
> ;;;
> ;;; this file:
> ;;;   http://user.it.uu.se/~embe8573/emacs-init/geh.el
> ;;;   https://dataswamp.org/~incal/emacs-init/geh.el
> 
> (let ((data-item 1)
>       (more-data 2) )
>     (defun echo-data (&optional data)
>       (interactive (list (read-number "number: " (or data-item more-data))))
>       (message "data: %s" (or data data-item)) ))
> ;; (echo-data 5)
> ;; (echo-data)
> ;; (call-interactively #'echo-data)
> 
> ;; Emacs bugs:
> ;;
> ;; 1. Byte compiler warnings (two cases) relating to the
> ;;    interactive spec:
> ;;
> ;;    geh.el:7:1: Warning: Unused lexical variable `more-data'
> ;;    geh.el:10:54: Warning: reference to free variable ‘data-item’
> ;;    geh.el:10:64: Warning: reference to free variable ‘more-data’
> ;;
> ;; 2. When the compiled version is used interactively:
> ;;
> ;;    Symbol's value as variable is void: data-item

How can the interactive spec use lexically-bound variables outside its
scope, when the interactive spec runs not at function definition time,
but at function invocation time, when those variables will be long
gone?  What is expected from the above code, and why?




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

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


Received: (at submit) by debbugs.gnu.org; 8 Nov 2021 23:40:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 08 18:40:53 2021
Received: from localhost ([127.0.0.1]:59865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mkEFt-0003r9-95
	for submit <at> debbugs.gnu.org; Mon, 08 Nov 2021 18:40:53 -0500
Received: from lists.gnu.org ([209.51.188.17]:60072)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <moasenwood@HIDDEN>) id 1mkEFp-0003qy-Ov
 for submit <at> debbugs.gnu.org; Mon, 08 Nov 2021 18:40:48 -0500
Received: from eggs.gnu.org ([209.51.188.92]:41622)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <moasenwood@HIDDEN>)
 id 1mkEFp-0002kI-4y
 for bug-gnu-emacs@HIDDEN; Mon, 08 Nov 2021 18:40:45 -0500
Received: from sender11-pp-o91.zoho.eu ([185.20.211.249]:25291)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <moasenwood@HIDDEN>)
 id 1mkEFm-0003zz-GI
 for bug-gnu-emacs@HIDDEN; Mon, 08 Nov 2021 18:40:44 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1636414836; cv=none; d=zohomail.eu; s=zohoarc; 
 b=UMv8tEV+q5W47ZaP37KpvVwoV//Km9frC18Skp/FTfgHOOMIUtZbDhSxli7yo8gehxWRWHR9NNm5CQysRPbOGnRcaiht0ErIsK/AzdlPC2mnbMl3374yfjRb3zeVMlpzznuUlKEzUYzwAgrPhMBJcbi7QpQMX7EkZG0bpoMdX/c=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu;
 s=zohoarc; t=1636414836;
 h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To;
 bh=6Wlqk7+HqaWiRs6KWNMamwXhsnox7bVq7rEgoFhWN0Q=; 
 b=AbZjpLNCnfDYSFhsuWYYXsvA4H26QPrh2dH+qMZmmr/ynGRwLx18aMQHKmhZXA8nHNKGACkXJXBJGzvVFMiO5cFvFDYYGVLuboczvxSwcy8Bp2Y+zxT4+O7grqk8zRaA/gYjaSg0fOBBSFPOqlkG6EjC6EgQwvYhh3MqEt9Da7E=
ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass  header.i=zoho.eu;
 spf=pass  smtp.mailfrom=moasenwood@HIDDEN;
 dmarc=pass header.from=<moasenwood@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1636414836; 
 s=admin; d=zoho.eu; i=moasenwood@HIDDEN;
 h=From:To:Message-ID:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding;
 bh=6Wlqk7+HqaWiRs6KWNMamwXhsnox7bVq7rEgoFhWN0Q=;
 b=MDJ+P3te2NCLruzIcTTMxFeNhEwqC5S2fT3tEz/PJamCHgQ0N2XTQWSOalt3QU0b
 5AhLLfaId779vhFfuTbLPp9qJtNDoDyu/pykdkcCgLzfZZaHWyOvKzqbMjHXzCe+fXT
 vzRukHHwEND2z40P7Y872uRdq05xqcoCf6FlRkxQ=
Received: from ebih.zoho.eu (c-178e225c.021-67-7570702.bbcust.telenor.se
 [92.34.142.23]) by mx.zoho.eu
 with SMTPS id 1636414834198178.8935180335236;
 Tue, 9 Nov 2021 00:40:34 +0100 (CET)
From: Emanuel Berg <moasenwood@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Message-ID: <87k0hi2p3i.fsf@HIDDEN>
Subject: 29.0.50; lexical scope closure, interactive spec byte compiler
 warnings/usage issue
Mail-Copies-To: never
X-Debbugs-Cc: Stefan Monnier <monnier@HIDDEN>
Date: Tue, 09 Nov 2021 00:40:33 +0100
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
Received-SPF: pass client-ip=185.20.211.249; envelope-from=moasenwood@HIDDEN;
 helo=sender11-pp-o91.zoho.eu
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, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)


(this should sum it up but see thread on gmane.emacs.help for background,
https://lists.gnu.org/archive/html/help-gnu-emacs/2021-11/msg00000.html
. keep it real)

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   http://user.it.uu.se/~embe8573/emacs-init/geh.el
;;;   https://dataswamp.org/~incal/emacs-init/geh.el

(let ((data-item 1)
      (more-data 2) )
    (defun echo-data (&optional data)
      (interactive (list (read-number "number: " (or data-item more-data)))=
)
      (message "data: %s" (or data data-item)) ))
;; (echo-data 5)
;; (echo-data)
;; (call-interactively #'echo-data)

;; Emacs bugs:
;;
;; 1. Byte compiler warnings (two cases) relating to the
;;    interactive spec:
;;
;;    geh.el:7:1: Warning: Unused lexical variable `more-data'
;;    geh.el:10:54: Warning: reference to free variable =E2=80=98data-item=
=E2=80=99
;;    geh.el:10:64: Warning: reference to free variable =E2=80=98more-data=
=E2=80=99
;;
;; 2. When the compiled version is used interactively:
;;
;;    Symbol's value as variable is void: data-item

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0)
 of 2021-10-04 built on ebih
Repository revision: c6be44d9b3ec09195f6279e9a503175f8fd60e14
Repository branch: master
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-x-toolkit=3Dno'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS
HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NOTIFY INOTIFY OLDXMENU PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF X11 XDBE XIM XPM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Article

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-netsplit-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-autojoin-mode: t
  erc-networks-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-scrolltobottom-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: linux
  auto-compression-mode: t
  buffer-read-only: t
  transient-mark-mode: t

Load-path shadows:
~/.emacs.d/emacs-init/isbn-verify hides /home/incal/.emacs.d/elpa/isbn-veri=
fy-2.0.0/isbn-verify
~/.emacs.d/emacs-init/signal hides /home/incal/.emacs.d/elpa/signal-2016081=
6.1438/signal
~/.emacs.d/lisp/abbrev hides /usr/local/share/emacs/29.0.50/lisp/abbrev
~/.emacs.d/emacs-init/misc hides /usr/local/share/emacs/29.0.50/lisp/misc

Features:
(shadow emacsbug w3m-save nnfolder tramp-cmds ibuf-ext ibuffer
ibuffer-loaddefs dash completion bug-reference pcmpl-unix
cl-print dired-aux flow-fill conf-mode mailalias grep xref
project ffap vc-hg vc-git diff-mode vc-bzr vc-dispatcher
erc-list erc-menu erc-track erc-netsplit gnus-draft canlock
w3m-symbol w3m-filter shortdoc help-fns radix-tree org-element
avl-tree generator ol-eww ol-rmail ol-mhe ol-irc ol-info
ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe
ol-docview ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src ob-comint org-pcomplete org-list org-faces
org-entities org-version ob-emacs-lisp ob-core ob-eval
org-table ol org-keys oc org-compat advice org-macs
org-loaddefs cal-menu calendar cal-loaddefs mm-archive
cl-extra mule-util mail-extr gnus-async gnus-bcklg gnus-dup qp
gnus-ml disp-table cursor-sensor pop3 nndraft nnmh nnml gnutls
network-stream nsm gnus-agent nnvirtual nntp gnus-cache tabify
term/linux cus-edit cus-start cus-load w3m-unisearch w3m-incal
w3m-session w3m-search checkdoc lisp-mnt lisp-incal ielm
nroff-mode compile-incal cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs summary
message-incal moggle smtpmail sendmail mail-to-many
gnus-server article w3m-download w3m-bookmark-more w3m-tabs
erc-connect bibtex-next-volume bibtex-incal bibtex-field
bibtex-book bibtex-autokey-insert bibtex yank xsel wrap-search
spell ispell sort-incal sort revert-buffer lpr tramp-cache
tramp-sh w3m-bookmark t-mouse man-incal tex-mode mode-line
kill keys iterate-files issn-verify isbn-verify help-incal
debug backtrace help-mode find-func apropos fill-incal
w3m-form sh-script executable markdown-mode rx noutline
outline easy-mmode man gnus-cite erc-match erc-button css-mode
smie sgml-mode facemenu imenu eww xdg url-queue mm-url color
compile epwgen em-hist em-pred esh-mode quit gnus-incal group
group-summary gnus-srvr erc-incal warnings erc-spell erc-ring
erc-pcomplete erc-kill erc-join erc-networks erc-iterate
erc-scroll erc-fill erc-stamp erc-goodies erc erc-backend pp
erc-loaddefs gnus-score score-mode gnus-msg gnus-art mm-uu
mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg
dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec
gnus-int gnus-range gnus-win message rmc puny rfc822 mml
mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums text-property-search mail-utils mm-util mail-prsvr
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg
esh-module esh-groups esh-util edit tabs dired-incal w3m-url
w3m doc-view jka-compr image-mode exif timezone w3m-hist
w3m-fb bookmark-w3m w3m-ems wid-edit w3m-favicon w3m-image
tab-line w3m-proc w3m-util thingatpt time-incal time-insert
file tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete comint ansi-color ring parse-time
iso8601 time-date ls-lisp format-spec sudo-user-path
find-command file-write-to window-incal get-search-string
search-regexp-in-files count caps-back buffer-menu
switch-to-buffer switch-to-buffer-regexp super scroll dired
dired-loaddefs close buc align-from-left align-incal string
abc w3m-load info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json
map url-vars seq gv subr-x byte-opt bytecomp byte-compile
cconv cl-loaddefs cl-lib paren iso-transl tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese composite
emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo x multi-tty make-network-process
emacs)

Memory information:
((conses 16 586752 116734)
 (symbols 48 37908 8)
 (strings 32 149835 13814)
 (string-bytes 1 5488915)
 (vectors 16 73343)
 (vector-slots 8 1600328 181967)
 (floats 8 660 670)
 (intervals 56 25131 587)
 (buffers 992 123))

--=20
underground experts united
https://dataswamp.org/~incal





Acknowledgement sent to Emanuel Berg <moasenwood@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#51695; 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: Thu, 11 Nov 2021 04:30:02 UTC

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