summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2015-01-16 23:48:26 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2015-01-16 23:48:26 -0500
commitd48c98cda83d2c74981c61a0b9d9b379c46217f4 (patch)
tree796b531601ab918a463a0a0b92283c849faf31b8 /lisp/emacs-lisp/eieio.el
parent24b7f77581c7eefe484db6cbbd661c04460c66aa (diff)
downloademacs-d48c98cda83d2c74981c61a0b9d9b379c46217f4.tar.gz
emacs-d48c98cda83d2c74981c61a0b9d9b379c46217f4.tar.bz2
emacs-d48c98cda83d2c74981c61a0b9d9b379c46217f4.zip
Don't enforce :protection in EIEIO objects any more
* doc/misc/eieio.texi (Slot Options): Document :protection as unsupported. * lisp/emacs-lisp/eieio-core.el (eieio--scoped-class-stack): Remove var. (eieio--scoped-class): Remove function. (eieio--with-scoped-class): Remove macro. Replace uses with `progn'. (eieio--slot-name-index): Don't check the :protection anymore. (eieio-initializing-object): Remove var. (eieio-set-defaults): Don't let-bind eieio-initializing-object. * lisp/emacs-lisp/eieio-generic.el (call-next-method): Don't bother checking eieio--scoped-class any more. * test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Use an explicit arg instead of eieio--scoped-class. Update all callers. * test/automated/eieio-tests.el (eieio-test-25-slot-tests) (eieio-test-26-default-inheritance, eieio-test-28-slot-protection) (eieio-test-30-slot-attribute-override) (eieio-test-31-slot-attribute-override-class-allocation): Don't check that we enforce :protection since we don't any more.
Diffstat (limited to 'lisp/emacs-lisp/eieio.el')
-rw-r--r--lisp/emacs-lisp/eieio.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 419a78be469..392316ccd75 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -76,8 +76,6 @@ being the slots residing in that class definition. Supported tags are:
- A string documenting use of this slot.
The following are extensions on CLOS:
- :protection - Specify protection for this slot.
- Defaults to `:public'. Also use `:protected', or `:private'.
:custom - When customizing an object, the custom :type. Public only.
:label - A text string label used for a slot when customizing.
:group - Name of a customization group this slot belongs in.
@@ -672,14 +670,13 @@ Called from the constructor routine.")
(defmethod shared-initialize ((obj eieio-default-superclass) slots)
"Set slots of OBJ with SLOTS which is a list of name/value pairs.
Called from the constructor routine."
- (eieio--with-scoped-class (eieio--object-class-object obj)
- (while slots
- (let ((rn (eieio--initarg-to-attribute (eieio--object-class-object obj)
- (car slots))))
- (if (not rn)
- (slot-missing obj (car slots) 'oset (car (cdr slots)))
- (eieio-oset obj rn (car (cdr slots)))))
- (setq slots (cdr (cdr slots))))))
+ (while slots
+ (let ((rn (eieio--initarg-to-attribute (eieio--object-class-object obj)
+ (car slots))))
+ (if (not rn)
+ (slot-missing obj (car slots) 'oset (car (cdr slots)))
+ (eieio-oset obj rn (car (cdr slots)))))
+ (setq slots (cdr (cdr slots)))))
(defgeneric initialize-instance (this &optional slots)
"Construct the new object THIS based on SLOTS.")