aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/eieio-base.el29
1 files changed, 22 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 4ba72aea56d..19809265ff0 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -264,12 +264,17 @@ objects found there."
264 (:method 264 (:method
265 ((objclass (subclass eieio-default-superclass)) inputlist) 265 ((objclass (subclass eieio-default-superclass)) inputlist)
266 266
267 (let ((slots (if (stringp (car inputlist)) 267 (let* ((name nil)
268 ;; Earlier versions of `object-write' added a 268 (slots (if (stringp (car inputlist))
269 ;; string name for the object, now obsolete. 269 (progn
270 (cdr inputlist) 270 ;; Earlier versions of `object-write' added a
271 inputlist)) 271 ;; string name for the object, now obsolete.
272 (createslots nil)) 272 ;; Save as 'name' in case this object is subclass
273 ;; of eieio-named with no :object-name slot specified.
274 (setq name (car inputlist))
275 (cdr inputlist))
276 inputlist))
277 (createslots nil))
273 ;; If OBJCLASS is an eieio autoload object, then we need to 278 ;; If OBJCLASS is an eieio autoload object, then we need to
274 ;; load it (we don't need the return value). 279 ;; load it (we don't need the return value).
275 (eieio--full-class-object objclass) 280 (eieio--full-class-object objclass)
@@ -286,7 +291,17 @@ objects found there."
286 291
287 (setq slots (cdr (cdr slots)))) 292 (setq slots (cdr (cdr slots))))
288 293
289 (apply #'make-instance objclass (nreverse createslots))))) 294 (let ((newobj (apply #'make-instance objclass (nreverse createslots))))
295
296 ;; Check for special case of subclass of `eieio-named', and do
297 ;; name assignment.
298 (when (and eieio-backward-compatibility
299 (object-of-class-p newobj eieio-named)
300 (not (oref newobj object-name))
301 name)
302 (oset newobj object-name name))
303
304 newobj))))
290 305
291(defun eieio-persistent-fix-value (proposed-value) 306(defun eieio-persistent-fix-value (proposed-value)
292 "Fix PROPOSED-VALUE. 307 "Fix PROPOSED-VALUE.