Subject: Re: bug#29220: 26.0.90; eieio-persistent-read fail to restore saved object.

From: [email-masked] (Pierre Téchoueyres)
Date: Fri, 10 Nov 2017 18:31:08 +0100

Hello Eric,
Firs, thank you for you fast answer. You fix resolved my first problem
with eieio-persistent-read, but I've hit another error when I try to use
complex objects save/restore.  In fact I try to find why pcache package
insnt working anymore with emacs 26.

So here is the same sample completed. Sorry.

;;; -*- lexical-binding: t -*-
(require 'eieio)
(require 'eieio-base)

(defclass eieio-fail (eieio-persistent eieio-named)
  ((version :initarg :version :initform nil)
   (version-constant :allocation :class)
   (entries :initarg :entries :initform (make-hash-table))))

(let* ((ef (make-instance 'eieio-fail :file "tmp"))
       (entries (slot-value ef 'entries))
       (ef2 (make-instance 'eieio-fail :file "tmp2"))
       (entries2 (slot-value ef2 'entries)))
  (puthash 'foo 42 entries2)
  (oset ef2 :entries entries2)
  (puthash 'ef2 ef2 entries)
  (oset ef2 :entries entries2)
  (oset ef :entries entries)  
  (eieio-persistent-save ef (concat "tmp-" emacs-version)))

(let* ((ef (eieio-persistent-read (concat "tmp-" emacs-version) 'eieio-fail t))
       (entries (slot-value ef 'entries))
       (entries2 (slot-value (gethash 'ef2 entries) 'entries)))
  ;; (pp ef)
  (pp (gethash 'foo entries2)))

Eric Abrahamsen <[email-masked]> writes:

> ...
>
> Yes, I made a bum commit to master, then fixed it, then cherry-picked
> the bum commit over to emacs-26 without fixing it. The fix is now
> cherry-picked as well, and I'm taking a short breather from patching
> Emacs.
>
> Sorry about this,
No worries
> Eric
Pierre