]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/eieio-core.el (eieio--class-constructor): Rename.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 17 Jan 2015 14:50:07 +0000 (09:50 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 17 Jan 2015 14:50:07 +0000 (09:50 -0500)
Fixes: debbugs:19620
(eieio--class-constructor): Rename from class-constructor, and make it an alias
for `identity'.  Update all callers.

lisp/ChangeLog
lisp/emacs-lisp/eieio-core.el
lisp/emacs-lisp/eieio-custom.el
lisp/emacs-lisp/eieio-datadebug.el
lisp/emacs-lisp/eieio.el

index bf00a8d666c0ec13b78da117828e21267f7a6a90..82cb1fa00b7d57e0507f1d4cdfcdeac390fcf369 100644 (file)
@@ -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.
index 0e589d6cf6e2167f8e8f4503804bf82f4e78c6fb..a82e887fa0c6471fef1d06063e647dc0fe0fb50b 100644 (file)
@@ -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."
index d0eaaf24d2b14140e6adf5c15deaf3548286cce3..8ab74ae3352ed6f2e2a3508cfd73c01e84170956 100644 (file)
@@ -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)
index 43d9a03932aedf137d450721ac1bdbb63adeb3fa..ab8d41e4ac4d31b85729d7ce41f75fdc14902fa6 100644 (file)
@@ -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
index e7a606ffd8c5e3eecbd554fc486b97c5df83573c..cda0c97a64ff9e073eaa122d70ff64cd8612e9cf 100644 (file)
@@ -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))
 
 \f
 ;;; 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")