From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jonas Bernoulli Newsgroups: gmane.emacs.bugs Subject: bug#61179: lambda inside interactive form of around advice isn't a closure Date: Wed, 01 Feb 2023 02:33:55 +0100 Message-ID: <87ilgm41a4.fsf@bernoul.li> References: <87tu082fcy.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33332"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61179@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 01 02:35:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pN21v-0008Po-6l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Feb 2023 02:35:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pN21m-0008Aq-Ad; Tue, 31 Jan 2023 20:35:10 -0500 Original-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 ) id 1pN21g-0008Aa-BN for bug-gnu-emacs@gnu.org; Tue, 31 Jan 2023 20:35:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pN21f-0004wx-3P for bug-gnu-emacs@gnu.org; Tue, 31 Jan 2023 20:35:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pN21e-0006T5-9W for bug-gnu-emacs@gnu.org; Tue, 31 Jan 2023 20:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jonas Bernoulli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Feb 2023 01:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61179 X-GNU-PR-Package: emacs Original-Received: via spool by 61179-submit@debbugs.gnu.org id=B61179.167521524424789 (code B ref 61179); Wed, 01 Feb 2023 01:35:02 +0000 Original-Received: (at 61179) by debbugs.gnu.org; 1 Feb 2023 01:34:04 +0000 Original-Received: from localhost ([127.0.0.1]:55387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pN20i-0006Rl-4R for submit@debbugs.gnu.org; Tue, 31 Jan 2023 20:34:04 -0500 Original-Received: from mail.hostpark.net ([212.243.197.30]:37296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pN20f-0006RK-3v for 61179@debbugs.gnu.org; Tue, 31 Jan 2023 20:34:03 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id D7DA216289; Wed, 1 Feb 2023 02:33:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-type:content-type:mime-version:message-id:date:date :references:in-reply-to:subject:subject:from:from:received :received; s=sel2011a; t=1675215237; bh=dqEU6i1VNXgra9eVAqFgmJLI UhWnDFDv9OYHf4sAdoI=; b=eg7VOGOXezuxIfNm+FKc54aVVhpP3geHMh2WUNzr LceWQKwUZ25lFkZS3mTt/ue3RbX7LVhKuUT/JO2dhHJZ9fg2PYw93g7chastkTTL ZFV7cHM5UXTziVQwdZzKqk0RvI0DzOfjMYfuzIYX/Pe1p1ar99akKTCv+tDVWfOE RmY= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Original-Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id EsGTqtK5QZDv; Wed, 1 Feb 2023 02:33:57 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 80C071622A; Wed, 1 Feb 2023 02:33:57 +0100 (CET) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254552 Archived-At: Stefan Monnier writes: > I think I'd try something like: > > (let* ((var :value) > (interactive-advice > (lambda (spec) > (message "interactive: %s" var) > (advice-eval-interactive-spec spec))) > (advice-body > (lambda (fn &rest args) > (message "body: %s" var) > (apply fn args)))) > (eval `(lambda (&rest args) > (interactive ,interactive-advice) > (apply ',advice-body args)) > t)) I'm having troubles falling asleep because my brain insists on rewording the following (even though --or perhaps exactly because-- there is not really any need to mention it at all). So I might as well try if typing it out helps. ;) I actually though of that, and the initial poc worked. I did that late at night also updated transient to use it. In the morning I noticed that there actually were many errors, and while I suspected that the failure had nothing to do with this part of my change, it still lost confidence in that approach, and since I felt some pressure to get things done before the Emacs pre-release I stopped pursuing it. Somehow I forgot about it when I wrote the above. Now that you have suggested the same, my confidence is back. And now that I have written the above, I should also be able to fall asleep. ;P > where the last 4 lines are "generic" and could be turned into > a helper function if you end up using it several times. > This should also minimize the amount of code that's hidden from the > compiler by the backquote. I'll only need it once; would you recommend using a helper in that case too? > > > Stefan Good night! Jonas zzzzZZz