Subject: Re: bug#33005: 27.0.50; Data loss with Gnus registry

From: Eric Abrahamsen <[email-masked]>
Date: Mon, 09 Dec 2019 14:29:38 -0800

On 12/09/19 20:38 PM, Michael Heerdegen wrote:
> Eric Abrahamsen <[email-masked]> writes:
>
>> Thanks for your continued patience with these problems. Don't
>> give up on the registry!
>
> Ok, I won't.
>
> I wanted now to add a hack to my config to save a backup of the registry
> save file every time it is saved.
>
> But now I wonder if that would not be a good idea anyway?  I think it
> could be done like in `gnus-save-newsrc-file' (look for
> `backup-buffer').  Does that make sense?
>
> I think I would then advice `gnus-registry-save' so that lots of backups
> are kept, in a separate folder, to prevent future data loss.

There are plenty of places where you could do a backup. The registry
itself is saved on the `gnus-save-newsrc-hook', that's a fine spot.

I was going to say you could add a method to `eieio-persistent-save',
maybe an :after method, and do it there, but now I wonder if you might
get into some sort of recursive loop, since you'd want to use
`eieio-persistent-save' in there, as well. I was thinking you should do
it at the lowest level possible, but this might actually be too low.
Part of the reason for "going low" is that there are routines for making
sure that non-ascii group names are mangled properly before saving.

Ooh, I just realized -- Lars wasn't into me properly encoding Gnus group
names in the .newsrc.eld file, but there's no reason the registry has to
be under that restriction, as the data is meant to be transient at some
level. I could leave the decoding routines in place and get rid of the encoders.

Anyway! That's a different question.