GNU bug report logs - #23947
Regression in EIEIO

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Mon, 11 Jul 2016 17:29:02 UTC

Severity: normal

Found in version 25.0.95

Fixed in version 25.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 23947 in the body.
You can then email your comments to 23947 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#23947; Package emacs. (Mon, 11 Jul 2016 17:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 11 Jul 2016 17:29:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Regression in EIEIO
Date: Mon, 11 Jul 2016 13:27:50 -0400
Package: Emacs
Version: 25.0.95


I finally tracked down why GNU ELPA's "rudel" package wasn't working
with Emacs-25, and it turns out to be a combination of two bugs
in the new EIEIO code.

Rudel seems to be the heaviest user of EIEIO so far (e.g. the only user
of the :c3 method invocation order, since the eieio-core code had
a plain bug which made it signal an error whenever that was used).

The patch below lets Rudel setup a shared buffer, so at least the core
functionality now works.  To my eyes, this is a very safe patch which
just fixes an incompatibility and an error I introduced in the new EIEIO
code when moving to cl-generic, so I think it should go to emacs-25.

Any objection?


        Stefan


2016-07-11  Stefan Monnier  <monnier <at> iro.umontreal.ca>

	* lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Better obey
	EIEIO's `no-applicable-method' calling convention.
	* lisp/emacs-lisp/eieio-core.el (eieio--class-precedence-c3): `class'
	is not a symbol but a class object.


diff --git a/lisp/emacs-lisp/eieio-compat.el b/lisp/emacs-lisp/eieio-compat.el
index 6d4798b..6aba8a3 100644
--- a/lisp/emacs-lisp/eieio-compat.el
+++ b/lisp/emacs-lisp/eieio-compat.el
@@ -188,7 +188,8 @@ eieio--defmethod
             (`no-applicable-method
              (setq method 'cl-no-applicable-method)
              (setq specializers `(generic ,@specializers))
-             (lambda (generic arg &rest args) (apply code arg generic args)))
+             (lambda (generic arg &rest args)
+               (apply code arg (cl--generic-name generic) (cons arg args))))
             (_ code))))
     (cl-generic-define-method
      method (unless (memq kind '(nil :primary)) (list kind))
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 631e4a4..223c2a6 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -976,7 +976,7 @@ eieio--class/struct-parents
 
 (defun eieio--class-precedence-c3 (class)
   "Return all parents of CLASS in c3 order."
-  (let ((parents (eieio--class-parents (cl--find-class class))))
+  (let ((parents (eieio--class-parents class)))
     (eieio--c3-merge-lists
      (list class)
      (append
@@ -1101,7 +1101,7 @@ eieio--generic-subclass-specializers
   (list eieio--generic-subclass-generalizer))
 
 
-;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "6aca3c1b5f751a01331761da45fc4f5c")
+;;;### (autoloads nil "eieio-compat" "eieio-compat.el" "dba4205b1a0d7133f1311d975b4d0ebe")
 ;;; Generated autoloads from eieio-compat.el
 
 (autoload 'eieio--defalias "eieio-compat" "\




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23947; Package emacs. (Mon, 11 Jul 2016 17:44:02 GMT) Full text and rfc822 format available.

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

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#23947: Regression in EIEIO
Date: Mon, 11 Jul 2016 19:42:44 +0200
[Message part 1 (text/plain, inline)]
On 2016-07-11 19:27, Stefan Monnier wrote:
> +               (apply code arg (cl--generic-name generic) (cons arg args))))

Hmm, why does `code' receive `arg' twice? (once as the first arg and once as the third one)

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23947; Package emacs. (Tue, 12 Jul 2016 13:07:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Clément Pit--Claudel <clement.pit <at> gmail.com>
Cc: 23947 <at> debbugs.gnu.org
Subject: Re: bug#23947: Regression in EIEIO
Date: Tue, 12 Jul 2016 09:06:03 -0400
>> +               (apply code arg (cl--generic-name generic) (cons arg args))))

> Hmm, why does `code' receive `arg' twice? (once as the first arg and
> once as the third one)

Because that's how EIEIO's `no-applicable-method' was defined.
More specifically, it takes (obj method &rest args) where `obj' is the
first arg that was passed to the method and `args' is the complete list
of arguments that were passed to the method.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23947; Package emacs. (Tue, 12 Jul 2016 21:14:02 GMT) Full text and rfc822 format available.

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

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 23947 <at> debbugs.gnu.org
Subject: Re: bug#23947: Regression in EIEIO
Date: Tue, 12 Jul 2016 23:13:23 +0200
[Message part 1 (text/plain, inline)]
On 07/12/2016 03:06 PM, Stefan Monnier wrote:
>>> +               (apply code arg (cl--generic-name generic) (cons arg args))))
> 
>> Hmm, why does `code' receive `arg' twice? (once as the first arg and
>> once as the third one)
> 
> Because that's how EIEIO's `no-applicable-method' was defined.
> More specifically, it takes (obj method &rest args) where `obj' is the
> first arg that was passed to the method and `args' is the complete list
> of arguments that were passed to the method.

Thanks Stefan :)

[signature.asc (application/pgp-signature, attachment)]

Added indication that bug 23947 blocks19759 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 14 Jul 2016 17:16:02 GMT) Full text and rfc822 format available.

Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Thu, 14 Jul 2016 19:09:01 GMT) Full text and rfc822 format available.

Notification sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
bug acknowledged by developer. (Thu, 14 Jul 2016 19:09:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: 23947-done <at> debbugs.gnu.org
Subject: Re: bug#23947: Regression in EIEIO
Date: Thu, 14 Jul 2016 15:09:55 -0400
Version: 25.1

Installed, thanks,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Aug 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 230 days ago.

Previous Next


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