Commit ca80ebc7 authored by Stefan Monnier's avatar Stefan Monnier

* lisp/emacs-lisp/eieio-core.el (eieio--class-constructor): Rename.

Fixes: debbugs:19620

(eieio--class-constructor): Rename from class-constructor, and make it an alias
for `identity'.  Update all callers.
parent 4610ce96
2015-01-17 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/eieio-core.el (eieio--class-constructor): Rename from
class-constructor, and make it an alias for `identity'.
Update all callers.
* emacs-lisp/eieio.el (eieio-constructor): Handle obsolete object name
argument here (bug#19620)...
(defclass): ...instead of in the constructor here.
......
......@@ -209,11 +209,8 @@ CLASS is a symbol." ;FIXME: Is it a vector or a symbol?
(format "#<class %s>" (symbol-name class)))
(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
(defmacro class-constructor (class)
"Return the symbol representing the constructor of CLASS."
(declare (debug t))
;; FIXME: How/when would this not be a costly identity function?
`(eieio--class-symbol (eieio--class-v ,class)))
(defalias 'eieio--class-constructor #'identity
"Return the symbol representing the constructor of CLASS.")
(defmacro eieio--class-option-assoc (list option)
"Return from LIST the found OPTION, or nil if it doesn't exist."
......
......@@ -184,7 +184,7 @@ Optional argument IGNORE is an extraneous parameter."
(if (not (widget-get widget :value))
(widget-put widget
:value (cond ((widget-get widget :objecttype)
(funcall (class-constructor
(funcall (eieio--class-constructor
(widget-get widget :objecttype))
"Custom-new"))
((widget-get widget :objectcreatefcn)
......
......@@ -88,7 +88,7 @@ PREBUTTONTEXT is some text between PREFIX and the object button."
"Name: ")
(let* ((cl (eieio-object-class obj))
(cv (eieio--class-v cl)))
(data-debug-insert-thing (class-constructor cl)
(data-debug-insert-thing (eieio--class-constructor cl)
prefix
"Class: ")
;; Loop over all the public slots
......
......@@ -301,7 +301,7 @@ In EIEIO, the class' constructor requires a name for use when printing.
`make-instance' in CLOS doesn't use names the way Emacs does, so the
class is used as the name slot instead when INITARGS doesn't start with
a string."
(apply (class-constructor class) initargs))
(apply (eieio--class-constructor class) initargs))
;;; Get/Set slots in an object.
......@@ -821,7 +821,7 @@ this object."
;; Each slot's slot is writen using its :writer.
(princ (make-string (* eieio-print-depth 2) ? ))
(princ "(")
(princ (symbol-name (class-constructor (eieio-object-class this))))
(princ (symbol-name (eieio--class-constructor (eieio-object-class this))))
(princ " ")
(prin1 (eieio-object-name-string this))
(princ "\n")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment