From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#68113: Wrong error message triggered in cl--generic-standard-method-combination Date: Sun, 7 Jan 2024 18:52:55 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26880"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68113@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 07 19:54:18 2024 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 1rMYHq-0006sR-On for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jan 2024 19:54:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMYHW-0001S4-Jr; Sun, 07 Jan 2024 13:53:58 -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 1rMYHU-0001Rg-Ua for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 13:53:56 -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 1rMYHU-0002nv-HG for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 13:53:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMYHa-0008Ab-3w for bug-gnu-emacs@gnu.org; Sun, 07 Jan 2024 13:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jan 2024 18:54:02 +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.170465359031332 (code B ref 68113); Sun, 07 Jan 2024 18:54:02 +0000 Original-Received: (at 68113) by debbugs.gnu.org; 7 Jan 2024 18:53:10 +0000 Original-Received: from localhost ([127.0.0.1]:33846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMYGk-00089H-AM for submit@debbugs.gnu.org; Sun, 07 Jan 2024 13:53:10 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:22420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMYGi-000893-Pt for 68113@debbugs.gnu.org; Sun, 07 Jan 2024 13:53:09 -0500 Original-Received: (qmail 55231 invoked by uid 3782); 7 Jan 2024 19:52:56 +0100 Original-Received: from acm.muc.de (p4fe15e24.dip0.t-ipconnect.de [79.225.94.36]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 07 Jan 2024 19:52:55 +0100 Original-Received: (qmail 13417 invoked by uid 1000); 7 Jan 2024 18:52:55 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:277523 Archived-At: Hello, Stefan. On Mon, Jan 01, 2024 at 23:39:57 -0500, Stefan Monnier wrote: > > , and at the time of calling, qualifiers was nil. So the call boiled > > down to > > (push method (alist-get nil mets-by-qual)) > > , and there was no element of mets-by-qual with a car of nil. So what > > can the push macro do? There's no list to push onto. It can generate > > code either > > (i) to signal an error; or > > (ii) to create a new element in the alist mets-by-qual with method being > > the single element of its cdr. > > In actual fact, it does (i), but (as reported in the bug report) gives > > the wrong message. > But as I pointed out, the normal macroexpansion does (ii), so the > problem *is* in the wrong macroexpansion. Yes indeed. > > That line of code is poor. It assumes that (alist-get (car qualifiers) > > mets-by-qual) will always return a list element, > No, it doesn't. The `gv-expander` for `alist-get` handles that case > just fine (tho for some reason not in your case, obviously). > > and fails to make any checks. It fails to check that qualifiers is > > a non-empty list before taking its car. > It's on purpose. The "nil" case is the common case, actually. > This has been working fine since Emacs-25, remember. Yes. > > Would you please check the code that signaled that error (you wrote it, I > > think), and let me know whether you find anything suspicious in it. > I already did. > Did you try the patch I sent? Yes I did, thanks. It showed up the real problem. I had modified the macroexpansion system in an attempt to use the framework in macroexp--expand-all but without the "base case", by fset'ing macroexp-macroexpand temporarily to an identity function. This was an attempt to strip symbols with position of their positions for bug #67455, getting lambda positions into the doc strings. In the end this attempt was hopeless, but I spent quite some time on it. I hadn't realised that macro expansion was central to gv.el. Bug #68113 might be a real bug, but I somehow doubt it. I'll close it as not a bug. Sorry to have wasted your time in the process. > Stefan -- Alan Mackenzie (Nuremberg, Germany).