From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65344: 28.2; Unable to Edebug cl-flet form which uses argument destructuring Date: Sun, 03 Sep 2023 12:09:53 -0400 Message-ID: References: <5184DD53-F121-405D-AEE9-6E72E17127EA@gmail.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35042"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Michael Heerdegen , brandon.irizarry@gmail.com, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Michael Albinus , 65344@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 03 19:28:21 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 1qcqtZ-0008t5-B3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Sep 2023 19:28:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcqtI-0008Nc-ON; Sun, 03 Sep 2023 13:28:04 -0400 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 1qcqtH-0008NA-3v for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2023 13:28:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcqtG-0005Q6-SF for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2023 13:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcqtG-0000iu-7W for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2023 13:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Sep 2023 17:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65344 X-GNU-PR-Package: emacs Original-Received: via spool by 65344-submit@debbugs.gnu.org id=B65344.16937620362722 (code B ref 65344); Sun, 03 Sep 2023 17:28:02 +0000 Original-Received: (at 65344) by debbugs.gnu.org; 3 Sep 2023 17:27:16 +0000 Original-Received: from localhost ([127.0.0.1]:46771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcqsV-0000hp-OR for submit@debbugs.gnu.org; Sun, 03 Sep 2023 13:27:16 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcqsU-0000hc-9Q for 65344@debbugs.gnu.org; Sun, 03 Sep 2023 13:27:15 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2A036441750; Sun, 3 Sep 2023 12:09:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1693757394; bh=lFyp7KTXpNmnMamoXzB8MKWTfvix+bhaeFIYOVSHQSo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TWri7spBInFBihwpmljnZRs7ZL+l+H3/aAK7z2QEVSXPmewTZy4FC+wga6FZNBMR6 zoNtq5ySpgbYE17RXSaL5d99TAYLCbl2YElPXl4mWdOJ30EHzfXqA2hptQwckUj0Uo 1xnhnf02PEzLbcvpN/ZyNhl/0CDAGiex/CHRQM1qyExcWEMJ0jW0Fq9vqbR0vePszh tS+nEBN8LQwA/e4Nodh5scd5xK2+Wx0hBaB+mGPe0UzpKrcqvzovIlFsKOd/S+R/NZ T6Lx2aKBfA3fX826HyYUw1myvmOvRUpCByWQXvRiwKDjVUya7O69y+QsUv999xAAv8 XJLVmdeRwMK+w== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A064544174C; Sun, 3 Sep 2023 12:09:54 -0400 (EDT) Original-Received: from pastel (104-222-114-42.cpe.teksavvy.com [104.222.114.42]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 66CEA120263; Sun, 3 Sep 2023 12:09:54 -0400 (EDT) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Sun, 03 Sep 2023 07:51:14 +0200") 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:269176 Archived-At: >> (prog1 >> #'(lambda (y) >> (edebug-enter 'edebug-anon5 (list y) >> #'(lambda nil :closure-dont-trim-context >> (edebug-after (edebug-before 0) 3 > > And here again the same mechanism, but with a bogus name. That's what > you are referring to, right? While in this specific case it would be technically possible to give it a better name, it's somewhere between hard and impossible to do it in general, so I'm not bothered by this "bogus name": that's already what is used in all other cases where anonymous functions are encountered. > Do you perhaps an idea how to solve that? I'm proposing we revert to the code we had originally, which avoids creating the spurious `f@cl-flet@4`. [ Tho with extra comments to explain why there's no `&name` on the (symbolp form) case. ] After all, your original report was due to a misunderstanding, thinking that `(cl-flet ((a ((b c)))) body)` treated `((b c))` as an arg list (for a function with an empty body) like Common Lisp's `flet` does, whereas `cl-flet` treats it as an expression (that returns the function). Stefan diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 850fbc69180..8d92acb0c95 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2075,15 +2075,16 @@ cl-flet \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" (declare (indent 1) - (debug ((&rest [&or (&define [&name symbolp "@cl-flet@"] + ;; The first (symbolp form) case doesn't use `&name' because + ;; it's hard to associate this name with the body of the function + ;; that `form' will return (bug#65344). + (debug ((&rest [&or (symbolp form) + (&define [&name symbolp "@cl-flet@"] [&name [] gensym] ;Make it unique! cl-lambda-list cl-declarations-or-string [&optional ("interactive" interactive)] - def-body) - (&define [&name symbolp "@cl-flet@"] - [&name [] gensym] ;Make it unique! - def-form)]) + def-body)]) cl-declarations body))) (let ((binds ()) (newenv macroexpand-all-environment)) (dolist (binding bindings)