]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/eieio.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / emacs-lisp / eieio.el
index a1b4a72bea63523f9c4aa473a1685fd0b035f5ef..47aff333d44e633403d4d66cec297282252746b1 100644 (file)
@@ -678,7 +678,8 @@ This class is not stored in the `parent' slot of a class vector."
 
 (setq eieio-default-superclass (cl--find-class 'eieio-default-superclass))
 
-(defalias 'standard-class 'eieio-default-superclass)
+(define-obsolete-function-alias 'standard-class
+  'eieio-default-superclass "25.2")
 
 (cl-defgeneric make-instance (class &rest initargs)
   "Make a new instance of CLASS based on INITARGS.
@@ -765,11 +766,7 @@ dynamically set from SLOTS."
   ;; Shared initialize will parse our slots for us.
   (shared-initialize this slots))
 
-(cl-defgeneric slot-missing (object slot-name operation &optional new-value)
-  "Method invoked when an attempt to access a slot in OBJECT fails.")
-
-(cl-defmethod slot-missing ((object eieio-default-superclass) slot-name
-                        _operation &optional _new-value)
+(cl-defgeneric slot-missing (object slot-name _operation &optional _new-value)
   "Method invoked when an attempt to access a slot in OBJECT fails.
 SLOT-NAME is the name of the failed slot, OPERATION is the type of access
 that was requested, and optional NEW-VALUE is the value that was desired
@@ -777,8 +774,9 @@ to be set.
 
 This method is called from `oref', `oset', and other functions which
 directly reference slots in EIEIO objects."
-  (signal 'invalid-slot-name (list (eieio-object-name object)
-                                  slot-name)))
+  (signal 'invalid-slot-name
+          (list (if (eieio-object-p object) (eieio-object-name object) object)
+                slot-name)))
 
 (cl-defgeneric slot-unbound (object class slot-name fn)
   "Slot unbound is invoked during an attempt to reference an unbound slot.")
@@ -815,22 +813,19 @@ first and modify the returned object.")
     (if params (shared-initialize nobj params))
     nobj))
 
-(cl-defgeneric destructor (this &rest params)
-  "Destructor for cleaning up any dynamic links to our object.")
-
-(cl-defmethod destructor ((_this eieio-default-superclass) &rest _params)
-  "Destructor for cleaning up any dynamic links to our object.
-Argument THIS is the object being destroyed.  PARAMS are additional
-ignored parameters."
+(cl-defgeneric destructor (_this &rest _params)
+  "Destructor for cleaning up any dynamic links to our object."
+  (declare (obsolete nil "25.2"))
   ;; No cleanup... yet.
-  )
+  nil)
 
-(cl-defgeneric object-print (this &rest strings)
-  "Pretty printer for object THIS.  Call function `object-name' with STRINGS.
+(cl-defgeneric object-print (this &rest _strings)
+  "Pretty printer for object THIS.
 
 It is sometimes useful to put a summary of the object into the
 default #<notation> string when using EIEIO browsing tools.
-Implement this method to customize the summary.")
+Implement this method to customize the summary."
+  (format "%S" this))
 
 (cl-defmethod object-print ((this eieio-default-superclass) &rest strings)
   "Pretty printer for object THIS.  Call function `object-name' with STRINGS.
@@ -938,11 +933,12 @@ this object."
 \f
 ;;; Unimplemented functions from CLOS
 ;;
-(defun change-class (_obj _class)
+(defun eieio-change-class (_obj _class)
   "Change the class of OBJ to type CLASS.
 This may create or delete slots, but does not affect the return value
 of `eq'."
   (error "EIEIO: `change-class' is unimplemented"))
+(define-obsolete-function-alias 'change-class 'eieio-change-class "25.2")
 
 ;; Hook ourselves into help system for describing classes and methods.
 ;; FIXME: This is not actually needed any more since we can click on the
@@ -970,41 +966,6 @@ variable PRINT-FUNCTION.  Optional argument NOESCAPE is passed to
 (advice-add 'edebug-prin1-to-string
             :around #'eieio-edebug-prin1-to-string)
 
-\f
-;;; Start of automatically extracted autoloads.
-\f
-;;;### (autoloads nil "eieio-custom" "eieio-custom.el" "916f54b818479a77a02f3ecccda84a11")
-;;; Generated autoloads from eieio-custom.el
-
-(autoload 'customize-object "eieio-custom" "\
-Customize OBJ in a custom buffer.
-Optional argument GROUP is the sub-group of slots to display.
-
-\(fn OBJ &optional GROUP)" nil nil)
-
-;;;***
-\f
-;;;### (autoloads nil "eieio-opt" "eieio-opt.el" "d00419c898056fadf2f8e491f864aa1e")
-;;; Generated autoloads from eieio-opt.el
-
-(autoload 'eieio-browse "eieio-opt" "\
-Create an object browser window to show all objects.
-If optional ROOT-CLASS, then start with that, otherwise start with
-variable `eieio-default-superclass'.
-
-\(fn &optional ROOT-CLASS)" t nil)
-
-(define-obsolete-function-alias 'eieio-help-class 'cl--describe-class "25.1")
-
-(autoload 'eieio-help-constructor "eieio-opt" "\
-Describe CTR if it is a class constructor.
-
-\(fn CTR)" nil nil)
-
-;;;***
-\f
-;;; End of automatically extracted autoloads.
-
 (provide 'eieio)
 
 ;;; eieio ends here