[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eieio-base patch to support EDE project loading
From: |
Stefan Monnier |
Subject: |
Re: eieio-base patch to support EDE project loading |
Date: |
Tue, 01 Oct 2019 08:14:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Hi Eric,
Thanks for the bug report and patch. I'll look at it ASAP,
Stefan
Eric Ludlam [2019-09-30 22:18:24] wrote:
> Hi,
>
> I've spent the last few years on emacs24, and just recently updated to newer
> version, and also attempted to switch to using built-in CEDET at the same
> time. (I'd been using sourceforge version before.) I am clearly a few
> years behind, hopefully you can forgive the transgression.
>
> In so doing, I discovered I couldn't load some of my old EDE projects.
> The error is in eieio-base.el (eieio-persistent-validate/fix-slot-value)
> with a call to `child-of-class-p' with a class being loaded that is
> still an autoload.
>
> The core problem is in eieio-core.el (eieio-defclass-autoload). There is
> a handy comment that explains it:
>
> ;; We used to store the list of superclasses in the `parent' slot (as a list
> ;; of class names). But now this slot holds a list of class objects, and
> ;; those parents may not exist yet, so the corresponding class objects may
> ;; simply not exist yet. So instead we just don't store the list of parents
> ;; here in eieio-defclass-autoload at all, since it seems that they're just
> ;; not needed before the class is actually loaded.
>
>
> Without that list of superclasses, `child-of-class-p' fails. Since having
> the superclass list in autoloads is a non-starter, this patch will
> un-autoload classes found in the file being read before the call to
> `child-of-class-p'.
>
> It would be better to store the superclasses in the autoload declaration so
> that extensible class hierarchies can be more dynamically loaded without
> internal checks with un-autoload, but I don't know enough about how the new
> version of eieio works to provide that patch.
>
> I didn't extensively test this beyond a couple old EDE projects of mine.
>
> Hope this helps.
>
> Eric (original author of eieio from a few years back)
>
> -----
>
>
> diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
> index 534613811d..9131263761 100644
> --- a/lisp/emacs-lisp/eieio-base.el
> +++ b/lisp/emacs-lisp/eieio-base.el
> @@ -342,6 +342,10 @@ eieio-persistent-validate/fix-slot-value
>
> ;; We have a predicate, but it doesn't satisfy the predicate?
> (dolist (PV (cdr proposed-value))
> + ;; If PV is an autoload class, then we must load it
> before `child-of-class-p' will
> + ;; successfully detect what it is.
> + (eieio-class-un-autoload (car PV))
> + ;; Test the class found in the file
> (unless (child-of-class-p (car PV) (car classtype))
> (error "Invalid object: slot member %s does not match
> class %s"
> (car PV) (car classtype))))
- Re: eieio-base patch to support EDE project loading,
Stefan Monnier <=