Let eieio-persistent-read read what object-write has written
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value): `object-write' may quote lists inside hash tables and vectors, so unquote those lists here. This patch allows the eieio-persistent write/restore process to perform a clean round trip. It only handles a very specific and limited range of object structures, but at least the write and read procedures match.
This commit is contained in:
parent
40ad1ff327
commit
f0cf4dc629
1 changed files with 17 additions and 8 deletions
|
@ -360,19 +360,28 @@ Second, any text properties will be stripped from strings."
|
||||||
((hash-table-p proposed-value)
|
((hash-table-p proposed-value)
|
||||||
(maphash
|
(maphash
|
||||||
(lambda (key value)
|
(lambda (key value)
|
||||||
(when (class-p (car-safe value))
|
(cond ((class-p (car-safe value))
|
||||||
(setf (gethash key proposed-value)
|
(setf (gethash key proposed-value)
|
||||||
(eieio-persistent-convert-list-to-object
|
(eieio-persistent-convert-list-to-object
|
||||||
value))))
|
value)))
|
||||||
|
((and (consp value)
|
||||||
|
(eq (car value) 'quote))
|
||||||
|
(setf (gethash key proposed-value)
|
||||||
|
(cadr value)))))
|
||||||
proposed-value)
|
proposed-value)
|
||||||
proposed-value)
|
proposed-value)
|
||||||
|
|
||||||
((vectorp proposed-value)
|
((vectorp proposed-value)
|
||||||
(dotimes (i (length proposed-value))
|
(dotimes (i (length proposed-value))
|
||||||
(when (class-p (car-safe (aref proposed-value i)))
|
(let ((val (aref proposed-value i)))
|
||||||
(aset proposed-value i
|
(cond ((class-p (car-safe val))
|
||||||
(eieio-persistent-convert-list-to-object
|
(aset proposed-value i
|
||||||
(aref 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))))))
|
||||||
proposed-value)
|
proposed-value)
|
||||||
|
|
||||||
((stringp proposed-value)
|
((stringp proposed-value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue