[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select 9d4baa3 165/218: Let eieio-persistent-
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select 9d4baa3 165/218: Let eieio-persistent-read read what object-write has written |
Date: |
Fri, 14 Dec 2018 03:35:22 -0500 (EST) |
branch: feature/gnus-select
commit 9d4baa3de68bd2125b84f2e51be36bf9f87c5188
Author: Eric Abrahamsen <address@hidden>
Commit: Andrew G Cohen <address@hidden>
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.
---
lisp/emacs-lisp/eieio-base.el | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index adc53e3..3a78877 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -360,19 +360,28 @@ Second, any text properties will be stripped from
strings."
((hash-table-p proposed-value)
(maphash
(lambda (key value)
- (when (class-p (car-safe value))
- (setf (gethash key proposed-value)
- (eieio-persistent-convert-list-to-object
- 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)))))
proposed-value)
proposed-value)
((vectorp proposed-value)
(dotimes (i (length proposed-value))
- (when (class-p (car-safe (aref proposed-value i)))
- (aset proposed-value i
- (eieio-persistent-convert-list-to-object
- (aref proposed-value i)))))
+ (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))))))
proposed-value)
((stringp proposed-value)
- [Emacs-diffs] feature/gnus-select 44c15fe 133/218: ; Spelling fix, (continued)
- [Emacs-diffs] feature/gnus-select 44c15fe 133/218: ; Spelling fix, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 3b15508 136/218: * lisp/textmodes/bibtex.el (bibtex-mark-entry): activate mark, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7387d26 144/218: Port to 32-bit sparc64, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 06a984e 138/218: Improve documentation of 'with-help-window', Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 4523701 147/218: * lisp/isearch.el (isearch-pre-command-hook): Replace cl-lib function., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 751ecf3 135/218: Set gnus-newsgroup-selection in the summary buffer, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 16fc857 142/218: ; Rewrap doc string, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 118f691 103/218: cedet: remove obsolete name args to constructors, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select aa16566 168/218: Fix Bug#30904, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8671f03 166/218: Adjust eieio persistence tests for expected failure, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 9d4baa3 165/218: Let eieio-persistent-read read what object-write has written,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select a1b7a1e 163/218: Add new tests for eieio persistence, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 267b827 170/218: Fix commit c24c5dc4a4, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 91bdd5a 157/218: Provide completion in vc-git-stash-* commands, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 8d80db1 154/218: Quieten eieio-test compilation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5502f96 161/218: * lisp/ibuf-ext.el (ibuffer-never-search-content-mode): Fix type., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 6dbf88e 171/218: Fix the MSDOS build, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d5a07be 172/218: * etc/NEWS: Add an entry for auth-source-pass., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c1d88db 173/218: Document DEFUN attributes, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0d04cb6 176/218: Fix byte-opt lists of pure functions etc., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b36a2f9 178/218: * lisp/org/ob-lisp.el (org-babel-lisp-eval-fn): Tweak type., Andrew G Cohen, 2018/12/14