]> code.delx.au - gnu-emacs/commitdiff
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Reuse oldc.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 27 Apr 2015 19:33:43 +0000 (15:33 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 27 Apr 2015 19:33:43 +0000 (15:33 -0400)
lisp/emacs-lisp/eieio-core.el

index 59d834837b05c6fb5c018ebd239318c872226a85..582ac8a6524ee2d730ae2e250514bbdada7d0355 100644 (file)
@@ -277,12 +277,12 @@ See `defclass' for more information."
   (setq eieio-hook nil)
 
   (let* ((oldc (let ((c (eieio--class-v cname))) (if (eieio--class-p c) c)))
-        (newc (if (and oldc (not (eieio--class-default-object-cache oldc)))
-                   ;; The oldc class is a stub setup by eieio-defclass-autoload.
-                   ;; Reuse it instead of creating a new one, so that existing
-                   ;; references stay valid.
-                   oldc
-                 (eieio--class-make cname)))
+        (newc (or oldc
+                   ;; Reuse `oldc' instead of creating a new one, so that
+                   ;; existing references stay valid.  E.g. when
+                   ;; reloading the file that does the `defclass', we don't
+                   ;; want to create a new class object.
+                   (eieio--class-make cname)))
         (groups nil) ;; list of groups id'd from slots
         (clearparent nil))