GNU bug report logs - #77123
29.1; call-next-method

Previous Next

Package: emacs;

Reported by: Christopher Stacy <cstacy <at> dtpq.com>

Date: Wed, 19 Mar 2025 18:21:02 UTC

Severity: normal

Found in version 29.1

Fixed in version 30.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77123 in the body.
You can then email your comments to 77123 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77123; Package emacs. (Wed, 19 Mar 2025 18:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Stacy <cstacy <at> dtpq.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Mar 2025 18:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Stacy <cstacy <at> dtpq.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Eric Ludlam <zappo <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: 29.1; call-next-method
Date: Wed, 19 Mar 2025 14:20:38 -0400
[Message part 1 (text/plain, inline)]
In GNU Emacs 29.1 (build 1, x86_64-apple-darwin20.6.0, Carbon Version
164 AppKit 2022.7) of 2023-08-08 built on Mac-1691499221282.local

eieio-version:  1.4

cl-call-next-method is not calling all the methods I expected.
It does call the methods in the direct superclasses, but it seems to be 
skipping all the indirect ones.

For a subclass FOO of A, B, a call-next-method from an instance of FOO 
will correctly call the  A and B methods. But if for example superclass 
A has mixins X and Y, neither the X or Y methods will be called. These 
are just primary methods. None of the inherited superclass methods are 
being run by call-next-method.

Attached is an example test program,
including test results. There are two
versions: one for Emacs Lisp,
and one is for Common Lisp (CLOS).
CL does it correctly (of course),
but EL gets the wrong answer.

I tested with two different CLOS implementations,
just to make sure I'm not crazy.

The files are identical except for
the compatibility preamble and results,
so you can compare them easily.
TEST#1 illustrates the case where things work right.
The differing answer is just in TEST#2.

Thanks for looking into this!
[simple-test.el (text/plain, attachment)]
[simple-test.lisp (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77123; Package emacs. (Wed, 19 Mar 2025 21:01:01 GMT) Full text and rfc822 format available.

Message #8 received at 77123 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Christopher Stacy <cstacy <at> dtpq.com>
Cc: 77123 <at> debbugs.gnu.org, Eric Ludlam <zappo <at> gnu.org>
Subject: Re: 29.1; call-next-method
Date: Wed, 19 Mar 2025 17:00:08 -0400
> Attached is an example test program,
> including test results. There are two
> versions: one for Emacs Lisp,
> and one is for Common Lisp (CLOS).
> CL does it correctly (of course),
> but EL gets the wrong answer.

I couldn't make your test work as is, but I used the adjusted file below
and it gives me:

    % /usr/bin/emacs -Q --batch -l ~/tmp/foo.el
    (base alpha beta winner)
    (base beta alpha glop flop)
    %

which seems to match your CLOS expectation.  But that was with Debian
testing's Emacs-30.  I don't have an Emacs-29 handy, so I used Debian
stable's Emacs-28.2 and indeed there I see your problem:

    % /usr/bin/emacs -Q --batch -l ~/tmp/foo.el
    (base alpha beta winner)
    (base glop flop)
    %

So, AFAICT this is already fixed in Emacs-30.  I did rework the way the
hierarchy is flattened (to share it with the same code used for major
mode hierarchies, resulting in the new function 'merge-ordered-lists'),
so that's not completely surprising, tho I can't remember noticing that
it would fix a bug.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77123; Package emacs. (Thu, 20 Mar 2025 00:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 77123 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Stacy <cstacy <at> dtpq.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 77123 <at> debbugs.gnu.org, Eric Ludlam <zappo <at> gnu.org>
Subject: Re: 29.1; call-next-method
Date: Wed, 19 Mar 2025 20:54:31 -0400
Thank You!






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77123; Package emacs. (Sat, 22 Mar 2025 11:52:01 GMT) Full text and rfc822 format available.

Message #14 received at 77123 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Christopher Stacy <cstacy <at> dtpq.com>
Cc: 77123 <at> debbugs.gnu.org, zappo <at> gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#77123: 29.1; call-next-method
Date: Sat, 22 Mar 2025 13:51:12 +0200
> Cc: 77123 <at> debbugs.gnu.org, Eric Ludlam <zappo <at> gnu.org>
> Date: Wed, 19 Mar 2025 20:54:31 -0400
> From: Christopher Stacy <cstacy <at> dtpq.com>
> 
> Thank You!

Should this bug be closed now?




bug Marked as fixed in versions 30.1. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 22 Mar 2025 11:57:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77123; Package emacs. (Sat, 22 Mar 2025 15:55:01 GMT) Full text and rfc822 format available.

Message #19 received at 77123 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Christopher Stacy <cstacy <at> dtpq.com>
Cc: 77123 <at> debbugs.gnu.org, Eric Ludlam <zappo <at> gnu.org>
Subject: Re: 29.1; call-next-method
Date: Sat, 22 Mar 2025 11:54:38 -0400
> Thank You!

Have you confirmed that the problem is fixed in Emacs-30 for the code
you actually care about (rather than for the artificial example you
reduced it to)?


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77123; Package emacs. (Sat, 22 Mar 2025 20:50:02 GMT) Full text and rfc822 format available.

Message #22 received at 77123 <at> debbugs.gnu.org (full text, mbox):

From: cstacy <at> dtpq.com
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 77123 <at> debbugs.gnu.org, Eric Ludlam <zappo <at> gnu.org>
Subject: Re: 29.1; call-next-method
Date: Sat, 22 Mar 2025 16:49:34 -0400
It worked 30.1
You can close it
TYVM

Sent from my iPhone

> On Mar 22, 2025, at 11:54 AM, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> 
> 
>> 
>> Thank You!
> 
> Have you confirmed that the problem is fixed in Emacs-30 for the code
> you actually care about (rather than for the artificial example you
> reduced it to)?
> 
> 
>        Stefan
> 




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Sat, 22 Mar 2025 21:51:02 GMT) Full text and rfc822 format available.

Notification sent to Christopher Stacy <cstacy <at> dtpq.com>:
bug acknowledged by developer. (Sat, 22 Mar 2025 21:51:02 GMT) Full text and rfc822 format available.

Message #27 received at 77123-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: cstacy <at> dtpq.com
Cc: Eric Ludlam <zappo <at> gnu.org>, 77123-done <at> debbugs.gnu.org
Subject: Re: 29.1; call-next-method
Date: Sat, 22 Mar 2025 17:50:37 -0400
> It worked 30.1
> You can close it

Thanks, closing,


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Apr 2025 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 86 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.