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#68113: Wrong error message triggered in cl--generic-standard-method-combination Date: Sun, 31 Dec 2023 15:01:05 -0500 Message-ID: References: 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="3188"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68113@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 31 21:02:24 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 1rK20t-0000cr-PC for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Dec 2023 21:02:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rK20Y-0007lU-K3; Sun, 31 Dec 2023 15:02:02 -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 1rK20X-0007l9-1O for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 15:02:01 -0500 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 1rK20W-00079q-It for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 15:02:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rK20X-00059V-Sy for bug-gnu-emacs@gnu.org; Sun, 31 Dec 2023 15:02:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Dec 2023 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68113 X-GNU-PR-Package: emacs Original-Received: via spool by 68113-submit@debbugs.gnu.org id=B68113.170405288618665 (code B ref 68113); Sun, 31 Dec 2023 20:02:01 +0000 Original-Received: (at 68113) by debbugs.gnu.org; 31 Dec 2023 20:01:26 +0000 Original-Received: from localhost ([127.0.0.1]:47067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rK1zp-0004g4-Ea for submit@debbugs.gnu.org; Sun, 31 Dec 2023 15:01:25 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rK1zm-0004UC-Cn for 68113@debbugs.gnu.org; Sun, 31 Dec 2023 15:01:15 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4EBB310009E; Sun, 31 Dec 2023 15:01:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1704052866; bh=gTx/PkbdUN3b0XmsLe7U6oN+ybLNebh7yTQitN6nUKY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WEh0n5u1jDkGz/yPEuDMLcXaFBwt2+y0zj/IMPBSdMq3d7LmPvbPqF/CLn8WJl8NK S59ygtvnFAFwfkwLTD783LTDZoqSMslPNID74xqG5Ch3vBtaXNVW1x+7FfeeD/dkkM DYonevWAI8CJ/MS6XRipeBwuNt7cvVuoy0O2pkQXrAoJ6lWi7UxwqEXTwkDpYpjyLf Y95GdeKN7qjmqaq/syoeRIl06M9sSm66ssAJzPNogJFFs68XxS2yAfs5K8FBvoOjdu 0fvMufpQTxy1EV5N8KmUfY6zqO5qbcem0dNPE2f2LYiGjtqMiqp6BKm7ZKFWh7xKD5 hwegt4UUJZ1vw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5EE7C10001D; Sun, 31 Dec 2023 15:01:06 -0500 (EST) Original-Received: from alfajor (unknown [207.96.224.130]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4BFB512082A; Sun, 31 Dec 2023 15:01:06 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Sat, 30 Dec 2023 10:46:42 +0000") 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:277161 Archived-At: >> I don't know why you're not getting that expansion, and I don't know >> either why you're getting that > >> (signal 'wrong-type-argument (list 'symbolp 'mets-by-qual)) > > I don't know, either. :-( As I say, I've tried instrumenting the `setq' > handling code in macroexp--expand-all, but haven't managed to get > anything pertinent output. Ah, indeed instead of `gv-delay-error` it could also come from `macroexp--expand-all`. The `macroexp.el` hunk below would rule that out, tho. >> AFAICT this weird code is likely generated by `gv-delay-error` but >> according to `grep` it's only used in `map-elt` so I can't see why it's >> showing up here. > >> I'd start debugging this with something like `M-x trace-function RET >> gv-get RET` and `M-x debug-on-entry RET gv-delay-error RET`. >> [ Tho, presumably you're seeing this during the bootstrap, so you'll >> probably want to add `message/debug` calls in the code instead. ] > > I am indeed seeing this in bootstrap, so it's message and a bit of prin1. Did you get to see the offending code in one of the outputs of `gv-get`? Hpw 'bout a test that tries to see when that code is generated, as in the `gv.el` patch below? Stefan diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 78601c0648e..5c461206820 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -467,10 +467,10 @@ macroexp--expand-all ,var (signal 'setting-constant (list ',var)))) ((symbolp var) - `(signal 'setting-constant (list ',var))) + (signal 'setting-constant (list var))) (t - `(signal 'wrong-type-argument - (list 'symbolp ',var)))) + (signal 'wrong-type-argument + (list 'symbolp var)))) nil 'compile-only var)))) (push assignment assignments)) (setq args (cddr args))) diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 9f40c1f3c93..9cfd6d4b423 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -86,6 +86,8 @@ gv-get with a (not necessarily copyable) Elisp expression that returns the value to set it to. DO must return an Elisp expression." + (message "Entering gv-get for %S" place) + (let ((res (cond ((symbolp place) (let ((me (macroexpand-1 place macroexpand-all-environment))) @@ -118,7 +120,13 @@ gv-get (let* ((setter (gv-setter head))) (gv--defsetter head (lambda (&rest args) `(,setter ,@args)) do (cdr place)))) - (gv-get me do)))))))) + (gv-get me do))))))) + )) + (if (string-match-p "(list 'symbolp 'mets-by-qual)" + (prin1-to-string res)) + (error "Gotcha!?")) + (message "Exiting gv-get for %S: %S" place res) + res)) (defun gv-setter (name) ;; The name taken from Scheme's SRFI-17. Actually, for SRFI-17, the argument