aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-01-17 09:50:07 -0500
committerStefan Monnier2015-01-17 09:50:07 -0500
commitca80ebc736346e196badd95ac524150b5c318683 (patch)
treedfbfd3361ea13d2ccc5d9c16602e08735a8c93eb
parent4610ce96c1a6d8574f85d8bd543fb8e1e02d6718 (diff)
downloademacs-ca80ebc736346e196badd95ac524150b5c318683.tar.gz
emacs-ca80ebc736346e196badd95ac524150b5c318683.zip
* 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 @@
12015-01-17 Stefan Monnier <monnier@iro.umontreal.ca> 12015-01-17 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * emacs-lisp/eieio-core.el (eieio--class-constructor): Rename from
4 class-constructor, and make it an alias for `identity'.
5 Update all callers.
6
3 * emacs-lisp/eieio.el (eieio-constructor): Handle obsolete object name 7 * emacs-lisp/eieio.el (eieio-constructor): Handle obsolete object name
4 argument here (bug#19620)... 8 argument here (bug#19620)...
5 (defclass): ...instead of in the constructor here. 9 (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?
209 (format "#<class %s>" (symbol-name class))) 209 (format "#<class %s>" (symbol-name class)))
210(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4") 210(define-obsolete-function-alias 'class-name #'eieio-class-name "24.4")
211 211
212(defmacro class-constructor (class) 212(defalias 'eieio--class-constructor #'identity
213 "Return the symbol representing the constructor of CLASS." 213 "Return the symbol representing the constructor of CLASS.")
214 (declare (debug t))
215 ;; FIXME: How/when would this not be a costly identity function?
216 `(eieio--class-symbol (eieio--class-v ,class)))
217 214
218(defmacro eieio--class-option-assoc (list option) 215(defmacro eieio--class-option-assoc (list option)
219 "Return from LIST the found OPTION, or nil if it doesn't exist." 216 "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."
184 (if (not (widget-get widget :value)) 184 (if (not (widget-get widget :value))
185 (widget-put widget 185 (widget-put widget
186 :value (cond ((widget-get widget :objecttype) 186 :value (cond ((widget-get widget :objecttype)
187 (funcall (class-constructor 187 (funcall (eieio--class-constructor
188 (widget-get widget :objecttype)) 188 (widget-get widget :objecttype))
189 "Custom-new")) 189 "Custom-new"))
190 ((widget-get widget :objectcreatefcn) 190 ((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."
88 "Name: ") 88 "Name: ")
89 (let* ((cl (eieio-object-class obj)) 89 (let* ((cl (eieio-object-class obj))
90 (cv (eieio--class-v cl))) 90 (cv (eieio--class-v cl)))
91 (data-debug-insert-thing (class-constructor cl) 91 (data-debug-insert-thing (eieio--class-constructor cl)
92 prefix 92 prefix
93 "Class: ") 93 "Class: ")
94 ;; Loop over all the public slots 94 ;; 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.
301`make-instance' in CLOS doesn't use names the way Emacs does, so the 301`make-instance' in CLOS doesn't use names the way Emacs does, so the
302class is used as the name slot instead when INITARGS doesn't start with 302class is used as the name slot instead when INITARGS doesn't start with
303a string." 303a string."
304 (apply (class-constructor class) initargs)) 304 (apply (eieio--class-constructor class) initargs))
305 305
306 306
307;;; Get/Set slots in an object. 307;;; Get/Set slots in an object.
@@ -821,7 +821,7 @@ this object."
821 ;; Each slot's slot is writen using its :writer. 821 ;; Each slot's slot is writen using its :writer.
822 (princ (make-string (* eieio-print-depth 2) ? )) 822 (princ (make-string (* eieio-print-depth 2) ? ))
823 (princ "(") 823 (princ "(")
824 (princ (symbol-name (class-constructor (eieio-object-class this)))) 824 (princ (symbol-name (eieio--class-constructor (eieio-object-class this))))
825 (princ " ") 825 (princ " ")
826 (prin1 (eieio-object-name-string this)) 826 (prin1 (eieio-object-name-string this))
827 (princ "\n") 827 (princ "\n")