sigma/pcache

Eieio constructor changes in Emacs 25

Closed this issue · 10 comments

There is a change coming in Emacs 25 that changes constructor arguments, as described in this bug report: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19620

Relevant quote:

Indeed, in Emacs-25, EIEIO's object names have been mostly dropped
(with some backward compatibility).
...
Note that this newname argument won't be provided in Emacs-25 if you
use make-instance, so you should try and change your code to use
eieio-named objects instead, if you need your objects to have a name.

I found the bug in that report because some backwards compatibility was broken, which broke pcache.el in turn. So pcache might need to be updated eventually.

Actually, pcache, even with the backwards compatibility of eieio, looks broken with current emacs git head, it seems that it doesn't pick up objects stored in a previous session.

hmm that's unfortunate...
Looks like objects have been restructured too, so I'm not overly surprised that persisted objects have become unreadable. Still in that case pcache should just throw away everything and pretend the cache is empty. Is that not the case ?

Yes, in my emacs from git head, it just sees the existing cache as empty.

But that's a problem: one of the projects using pcache is unicode-fonts (https://github.com/rolandwalker/unicode-fonts), which stores in a cache a list of available fonts, together with calculated character mappings and the like. It takes quite a while to regenerate, so when pcache breaks, unicode-fonts is the most visible (to me) victim. On my laptop it adds something like 30 seconds to each start-up, because the font information cache gets regenerated.

so you mean the cache is not properly repopulated after that ?
In that case that would be a bug on my side, throwing away the cache is unavoidable from time to time, but a new (valid) one should be regenerated in its place

It ignores every cached object it generates, so the cache is seen as empty every single session. During each session the cache just works like normal variables.

alright, I'll have a look at that, thanks for the details

Also, search for EIEIO on this page: http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-01/threads.html There are at least a few different compatibility bugs there, so pcache isn't the only package being broken. I don't know much about EIEIO myself, so I don't really understand what changes are being made to it, unfortunately. It does seem there's some valid rationale for it, whatever it is.

I think the problem should be solved in pcache 0.3.0, that I just released. It was pretty tricky though, since I wanted to be backward-compatible with Emacs 24 and I was actually making use of those object names that have been deemed useless...

Anyway, if you could confirm that it works for you, or reopen, that'd be great.
Thanks

Looks like cache is reloaded properly now. Thank you.

awesome, thanks for verifying