all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 68113@debbugs.gnu.org
Subject: bug#68113: Wrong error message triggered in cl--generic-standard-method-combination
Date: Sun, 7 Jan 2024 18:52:55 +0000	[thread overview]
Message-ID: <ZZrzBx_Xf7sW4l19@ACM> (raw)
In-Reply-To: <jwv8r584amr.fsf-monnier+emacs@gnu.org>

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).





  reply	other threads:[~2024-01-07 18:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-29 16:50 bug#68113: Wrong error message triggered in cl--generic-standard-method-combination Alan Mackenzie
2023-12-29 17:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-30 10:46   ` Alan Mackenzie
2023-12-31 20:01     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-01 19:36       ` Alan Mackenzie
2024-01-02  4:39         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-07 18:52           ` Alan Mackenzie [this message]
2024-01-07 19:12             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZZrzBx_Xf7sW4l19@ACM \
    --to=acm@muc.de \
    --cc=68113@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.