emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ca80ebc: * lisp/emacs-lisp/eieio-core.el (eieio--cl


From: Stefan Monnier
Subject: [Emacs-diffs] master ca80ebc: * lisp/emacs-lisp/eieio-core.el (eieio--class-constructor): Rename.
Date: Sat, 17 Jan 2015 14:50:13 +0000

branch: master
commit ca80ebc736346e196badd95ac524150b5c318683
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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.
---
 lisp/ChangeLog                     |    4 ++++
 lisp/emacs-lisp/eieio-core.el      |    7 ++-----
 lisp/emacs-lisp/eieio-custom.el    |    2 +-
 lisp/emacs-lisp/eieio-datadebug.el |    2 +-
 lisp/emacs-lisp/eieio.el           |    4 ++--
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf00a8d..82cb1fa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
 2015-01-17  Stefan Monnier  <address@hidden>
 
+       * 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 0e589d6..a82e887 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 d0eaaf2..8ab74ae 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 43d9a03..ab8d41e 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 e7a606f..cda0c97 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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]