summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio-custom.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-12-29 12:11:09 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2014-12-29 12:11:09 -0500
commit232823a1f163cebeafdab20ea2eb3f2da9645185 (patch)
tree59df22737fb162918c05c533ee9b19548a6b21b3 /lisp/emacs-lisp/eieio-custom.el
parentee93d7ad4291a0946efe3197481cfbeff92f29b8 (diff)
downloademacs-232823a1f163cebeafdab20ea2eb3f2da9645185.tar.gz
lisp/emacs-lisp/eieio*.el: Reduce object header to 1 slot
* lisp/emacs-lisp/eieio-core.el (eieio--with-scoped-class): Use let-binding. (object): Remove first (constant) slot; rename second to `class-tag'. (eieio--object-class-object, eieio--object-class-name): New funs to replace eieio--object-class. (eieio--class-object, eieio--class-p): New functions. (same-class-fast-p): Make it a defsubst, change its implementation to check the class objects rather than their names. (eieio-object-p): Rewrite. (eieio-defclass): Adjust the object initialization according to the new object layout. (eieio--scoped-class): Declare it returns a class object (not a class name any more). Adjust calls accordingly (along with calls to eieio--with-scoped-class). (eieio--slot-name-index): Rename from eieio-slot-name-index and change its class arg to be a class object. Adjust callers accordingly. (eieio-slot-originating-class-p): Make its start-class arg a class object. Adjust all callers. (eieio--initarg-to-attribute): Rename from eieio-initarg-to-attribute. Make its `class' arg a class object. Adjust all callers. * lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Use eieio--slot-name-index rather than eieio-slot-name-index. * lisp/emacs-lisp/eieio.el (child-of-class-p): Make it accept class objects additionally to class names. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Adjust to new semantics of eieio--scoped-class. (eieio-test-match): Improve error feedback.
Diffstat (limited to 'lisp/emacs-lisp/eieio-custom.el')
-rw-r--r--lisp/emacs-lisp/eieio-custom.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/eieio-custom.el b/lisp/emacs-lisp/eieio-custom.el
index 8172cbeef6f..15a11ddb20f 100644
--- a/lisp/emacs-lisp/eieio-custom.el
+++ b/lisp/emacs-lisp/eieio-custom.el
@@ -193,7 +193,7 @@ Optional argument IGNORE is an extraneous parameter."
(let* ((chil nil)
(obj (widget-get widget :value))
(master-group (widget-get widget :eieio-group))
- (cv (eieio--class-v (eieio--object-class obj)))
+ (cv (eieio--object-class-object obj))
(slots (eieio--class-public-a cv))
(flabel (eieio--class-public-custom-label cv))
(fgroup (eieio--class-public-custom-group cv))
@@ -208,7 +208,8 @@ Optional argument IGNORE is an extraneous parameter."
chil)))
;; Display information about the group being shown
(when master-group
- (let ((groups (class-option (eieio--object-class obj) :custom-groups)))
+ (let ((groups (class-option (eieio--object-class-name obj)
+ :custom-groups)))
(widget-insert "Groups:")
(while groups
(widget-insert " ")
@@ -261,7 +262,7 @@ Optional argument IGNORE is an extraneous parameter."
(let ((s (symbol-name
(or
(class-slot-initarg
- (eieio--object-class obj)
+ (eieio--object-class-name obj)
(car slots))
(car slots)))))
(capitalize
@@ -288,7 +289,7 @@ Optional argument IGNORE is an extraneous parameter."
"Get the value of WIDGET."
(let* ((obj (widget-get widget :value))
(master-group eieio-cog)
- (cv (eieio--class-v (eieio--object-class obj)))
+ (cv (eieio--object-class-object obj))
(fgroup (eieio--class-public-custom-group cv))
(wids (widget-get widget :children))
(name (if (widget-get widget :eieio-show-name)
@@ -296,7 +297,7 @@ Optional argument IGNORE is an extraneous parameter."
nil))
(chil (if (widget-get widget :eieio-show-name)
(nthcdr 1 wids) wids))
- (cv (eieio--class-v (eieio--object-class obj)))
+ (cv (eieio--object-class-object obj))
(slots (eieio--class-public-a cv))
(fcust (eieio--class-public-custom cv)))
;; If there are any prefix widgets, clear them.
@@ -451,7 +452,7 @@ Must return the created widget."
(vector (concat "Group " (symbol-name group))
(list 'customize-object obj (list 'quote group))
t))
- (class-option (eieio--object-class obj) :custom-groups)))
+ (class-option (eieio--object-class-name obj) :custom-groups)))
(defvar eieio-read-custom-group-history nil
"History for the custom group reader.")
@@ -459,7 +460,7 @@ Must return the created widget."
(defmethod eieio-read-customization-group ((obj eieio-default-superclass))
"Do a completing read on the name of a customization group in OBJ.
Return the symbol for the group, or nil"
- (let ((g (class-option (eieio--object-class obj) :custom-groups)))
+ (let ((g (class-option (eieio--object-class-name obj) :custom-groups)))
(if (= (length g) 1)
(car g)
;; Make the association list