mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 06:20:43 -08:00
Merge remote-tracking branch 'savannah/master' into HEAD
This commit is contained in:
commit
ee3df1483a
14 changed files with 363 additions and 249 deletions
|
|
@ -730,7 +730,8 @@ Argument FN is the function calling this verifier."
|
|||
(guard (not (memq name eieio--known-slot-names))))
|
||||
(macroexp--warn-and-return
|
||||
(format-message "Unknown slot `%S'" name) exp 'compile-only))
|
||||
(_ exp)))))
|
||||
(_ exp))))
|
||||
(gv-setter eieio-oset))
|
||||
(cl-check-type slot symbol)
|
||||
(cl-check-type obj (or eieio-object class))
|
||||
(let* ((class (cond ((symbolp obj)
|
||||
|
|
@ -755,6 +756,7 @@ Argument FN is the function calling this verifier."
|
|||
(defun eieio-oref-default (obj slot)
|
||||
"Do the work for the macro `oref-default' with similar parameters.
|
||||
Fills in OBJ's SLOT with its default value."
|
||||
(declare (gv-setter eieio-oset-default))
|
||||
(cl-check-type obj (or eieio-object class))
|
||||
(cl-check-type slot symbol)
|
||||
(let* ((cl (cond ((symbolp obj) (cl--find-class obj))
|
||||
|
|
|
|||
|
|
@ -513,8 +513,7 @@ The CLOS function `class-direct-subclasses' is aliased to this function."
|
|||
"Set the value in OBJ for slot SLOT to VALUE.
|
||||
SLOT is the slot name as specified in `defclass' or the tag created
|
||||
with in the :initarg slot. VALUE can be any Lisp object."
|
||||
(declare (obsolete "use (setf (oref ..) ..) instead" "28.1")
|
||||
(debug (form symbolp form)))
|
||||
(declare (debug (form symbolp form)))
|
||||
`(eieio-oset ,obj (quote ,slot) ,value))
|
||||
|
||||
(defmacro oset-default (class slot value)
|
||||
|
|
@ -522,8 +521,7 @@ with in the :initarg slot. VALUE can be any Lisp object."
|
|||
The default value is usually set with the :initform tag during class
|
||||
creation. This allows users to change the default behavior of classes
|
||||
after they are created."
|
||||
(declare (obsolete "use (setf (oref-default ..) ..) instead" "28.1")
|
||||
(debug (form symbolp form)))
|
||||
(declare (debug (form symbolp form)))
|
||||
`(eieio-oset-default ,class (quote ,slot) ,value))
|
||||
|
||||
;;; CLOS queries into classes and slots
|
||||
|
|
@ -647,14 +645,6 @@ If SLOT is unbound, do nothing."
|
|||
nil
|
||||
(eieio-oset object slot (delete item (eieio-oref object slot)))))
|
||||
|
||||
;;; Here are some CLOS items that need the CL package
|
||||
;;
|
||||
|
||||
;; FIXME: Shouldn't this be a more complex gv-expander which extracts the
|
||||
;; common code between oref and oset, so as to reduce the redundant work done
|
||||
;; in (push foo (oref bar baz)), like we do for the `nth' expander?
|
||||
(gv-define-simple-setter eieio-oref eieio-oset)
|
||||
|
||||
|
||||
;;;
|
||||
;; We want all objects created by EIEIO to have some default set of
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue