summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-01-17 09:50:07 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2015-01-17 09:50:07 -0500
commitca80ebc736346e196badd95ac524150b5c318683 (patch)
treedfbfd3361ea13d2ccc5d9c16602e08735a8c93eb
parent4610ce96c1a6d8574f85d8bd543fb8e1e02d6718 (diff)
downloademacs-ca80ebc736346e196badd95ac524150b5c318683.tar.gz
* 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.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/emacs-lisp/eieio-core.el7
-rw-r--r--lisp/emacs-lisp/eieio-custom.el2
-rw-r--r--lisp/emacs-lisp/eieio-datadebug.el2
-rw-r--r--lisp/emacs-lisp/eieio.el4
5 files changed, 10 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf00a8d666c..82cb1fa00b7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
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.
diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el
index 0e589d6cf6e..a82e887fa0c 100644
--- a/lisp/emacs-lisp/eieio-core.el
+++ b/lisp/emacs-lisp/eieio-core.el
@@ -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."
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index d0eaaf24d2b..8ab74ae3352 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -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)
diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el
index 43d9a03932a..ab8d41e4ac4 100644
--- a/lisp/emacs-lisp/eieio-datadebug.el
+++ b/lisp/emacs-lisp/eieio-datadebug.el
@@ -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
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index e7a606ffd8c..cda0c97a64f 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -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")