summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio-base.el
diff options
context:
space:
mode:
authorEric Abrahamsen <eric@ericabrahamsen.net>2018-04-08 16:49:20 -0700
committerEric Abrahamsen <eric@ericabrahamsen.net>2018-04-13 10:56:55 -0700
commitffbb4e8d542df44ced5afd89221b0dfb234d8525 (patch)
tree60371b2a8b54396378a029e724f36eee9e367605 /lisp/emacs-lisp/eieio-base.el
parentde28ae70effd64755e7543fd2cef90f8de5d8019 (diff)
downloademacs-ffbb4e8d542df44ced5afd89221b0dfb234d8525.tar.gz
emacs-ffbb4e8d542df44ced5afd89221b0dfb234d8525.tar.bz2
emacs-ffbb4e8d542df44ced5afd89221b0dfb234d8525.zip
Further fix to eieio-persistent
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): Make handling of hash tables and vectors recursive. This is necessary because the write process, in `eieio-override-prin1' is also recursive. With any luck, this will be the last fix of its kind. If that's true, cherry-pick to Emacs 26.2 later on.
Diffstat (limited to 'lisp/emacs-lisp/eieio-base.el')
-rw-r--r--lisp/emacs-lisp/eieio-base.el32
1 files changed, 15 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 9f9f870a757..75709ddc0a8 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -360,32 +360,30 @@ Second, any text properties will be stripped from strings."
proposed-value))))
;; For hash-tables and vectors, the top-level `read' will not
;; "look inside" member values, so we need to do that
- ;; explicitly.
+ ;; explicitly. Because `eieio-override-prin1' is recursive in
+ ;; the case of hash-tables and vectors, we recurse
+ ;; `eieio-persistent-validate/fix-slot-value' here as well.
((hash-table-p proposed-value)
(maphash
(lambda (key value)
- (cond ((class-p (car-safe value))
- (setf (gethash key proposed-value)
- (eieio-persistent-convert-list-to-object
- value)))
- ((and (consp value)
- (eq (car value) 'quote))
- (setf (gethash key proposed-value)
- (cadr value)))))
+ (setf (gethash key proposed-value)
+ (if (class-p (car-safe value))
+ (eieio-persistent-convert-list-to-object
+ value)
+ (eieio-persistent-validate/fix-slot-value
+ class slot value))))
proposed-value)
proposed-value)
((vectorp proposed-value)
(dotimes (i (length proposed-value))
(let ((val (aref proposed-value i)))
- (cond ((class-p (car-safe val))
- (aset proposed-value i
- (eieio-persistent-convert-list-to-object
- (aref proposed-value i))))
- ((and (consp val)
- (eq (car val) 'quote))
- (aset proposed-value i
- (cadr val))))))
+ (aset proposed-value i
+ (if (class-p (car-safe val))
+ (eieio-persistent-convert-list-to-object
+ val)
+ (eieio-persistent-validate/fix-slot-value
+ class slot val)))))
proposed-value)
((stringp proposed-value)