Closed minad closed 6 months ago
No, I spent several hours trying to make it work before I filed this bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68482
Thanks, I see. That's unfortunate. Hopefully this could be fixed in multisession. Or is persist better than multisession in every aspect? Would it make sense to propose replacing multisession with persist inside the Emacs core?
I don't know. multisession has some functionality to sync values between simultaneous sessions (without conflict resolution), which persist doesn't do. And the APIs are a bit different.
I already asked this question on emacs-devel a year or so ago, supposedly while Lars was still around, but my question was never answered. It didn't seem like anyone was interested enough to investigate or decide.
At this moment, it seems that persist is more usable, since certain values just don't work with multisession, without warning or error or explanation (i.e. a map gets saved the first time, but then doesn't get updated on disk when the value is changed). So AFAICT I couldn't recommend that anyone use multisession until that bug is fixed. If it gets fixed, I suppose it could be up to the user to use whichever API he prefers.
I read your bug report. I don't think multisession writes to storage if you update elements of a map. You have to update the root value. It seems something like "multisession-write", analogous to persist-save
, would be nice for this case.
Incidentally, it looks like you are writing activities to disk once per activity with the default configuration (and once again via persist--save-all
) on quit. I didn't test this, was just skimming.
I read your bug report. I don't think multisession writes to storage if you update elements of a map. You have to update the root value. It seems something like "multisession-write", analogous to
persist-save
, would be nice for this case.
Yes, IIRC I tried to do something hacky like that, e.g.:
(setf (map-elt (multisession-value activity-activities) name) activity
(multisession-value activity-activities) (multisession-value activity-activities))
But that didn't work to force multisession
to write the new value. And with an alist, I don't know if that even could be enough, because if the first cons cell didn't change... So it might be required to copy-sequence
to make it write the new value. But persist
"just works" here, until multisession
is fixed.
Incidentally, it looks like you are writing activities to disk once per activity with the default configuration (and once again via
persist--save-all
) on quit. I didn't test this, was just skimming.
I think you're right. I'll fix that. Thanks.
On 29.1 we have multisession. Would that work too?