summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio-base.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/eieio-base.el')
-rw-r--r--lisp/emacs-lisp/eieio-base.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 62f4c82026e..534613811d4 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -3,7 +3,7 @@
;;; Copyright (C) 2000-2002, 2004-2005, 2007-2019 Free Software
;;; Foundation, Inc.
-;; Author: Eric M. Ludlam <zappo@gnu.org>
+;; Author: Eric M. Ludlam <zappo@gnu.org>
;; Keywords: OO, lisp
;; Package: eieio
@@ -71,7 +71,7 @@ All slots are unbound, except those initialized with PARAMS."
(let ((nobj (if (stringp (car params))
(cl-call-next-method obj (pop params))
(cl-call-next-method obj))))
- (dolist (descriptor (eieio-class-slots (class-of nobj)))
+ (dolist (descriptor (eieio-class-slots (eieio-object-class nobj)))
(let ((slot (eieio-slot-descriptor-name descriptor)))
(slot-makeunbound nobj slot)))
(when params
@@ -506,12 +506,21 @@ instance."
(cl-defmethod eieio-object-name-string ((obj eieio-named))
"Return a string which is OBJ's name."
(or (slot-value obj 'object-name)
- (symbol-name (eieio-object-class obj))))
+ (cl-call-next-method)))
-(cl-defmethod eieio-object-set-name-string ((obj eieio-named) name)
+(cl-defgeneric eieio-object-set-name-string (obj name)
"Set the string which is OBJ's NAME."
+ (declare (obsolete "inherit from `eieio-named' and use (setf (slot-value OBJ \\='object-name) NAME) instead" "25.1"))
(cl-check-type name string)
- (eieio-oset obj 'object-name name))
+ (setf (gethash obj eieio--object-names) name))
+(define-obsolete-function-alias
+ 'object-set-name-string 'eieio-object-set-name-string "24.4")
+
+(with-suppressed-warnings ((obsolete eieio-object-set-name-string))
+ (cl-defmethod eieio-object-set-name-string ((obj eieio-named) name)
+ "Set the string which is OBJ's NAME."
+ (cl-check-type name string)
+ (eieio-oset obj 'object-name name)))
(cl-defmethod clone ((obj eieio-named) &rest params)
"Clone OBJ, initializing `:parent' to OBJ.