GNU bug report logs - #29541
27.0.50; Use generic function when restoring eieio-persistent, remove validation

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Sun, 3 Dec 2017 00:13:02 UTC

Severity: wishlist

Tags: patch

Found in version 27.0.50

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Subject: bug#29541: closed (Re: bug#29541: 27.0.50; Use generic function
 when restoring eieio-persistent, remove validation)
Date: Fri, 28 Aug 2020 15:25:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#29541: 27.0.50; Use generic function when restoring eieio-persistent, remove validation

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 29541 <at> debbugs.gnu.org.

-- 
29541: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29541
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 29541 <at> debbugs.gnu.org, 29541-done <at> debbugs.gnu.org
Subject: Re: bug#29541: 27.0.50; Use generic function when restoring
 eieio-persistent, remove validation
Date: Fri, 28 Aug 2020 08:24:10 -0700
On 08/28/20 16:18 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> This was quite a while ago, and the original patch no longer applies.
>> I've done up the same changes as two separate patches: one removing
>> extra validation, and the other creating a generic function for
>> constructing eieio-persistent objects. All the tests pass.
>
> I've just skimmed the code, but it looks good to me.  I'd say just apply
> it and then see whether there is any fallout (but I don't expect there
> to be).

I've also used this with the gnus registry and EBDB, which should
exercise it fairly well. I'll push now.

[Message part 3 (message/rfc822, inline)]
From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Use generic function when restoring eieio-persistent, remove
 validation
Date: Sat, 02 Dec 2017 16:10:07 -0800
[Message part 4 (text/plain, inline)]
The attached patch is a proposal that would replace the function
`eieio-persistent-convert-list-to-object' with a generic method
`eieio-persistent-make-instance'. It also removes all slot validation in
the read process.

Considerations:

1. `object-write' is already a method. That means the writing process
can be overridden and customized, but the reading process can't, which
removes most of the benefit of being able to override the write. This
would allow "matching" methods for writing and reading.

2. This version checks *all* slot values, including all elements inside
lists, cons-cells, etc. The safety consideration is mostly removing text
properties (specifically the display property), and this version checks
exhaustively.

3. I removed slot validation because it complicates the restoration
process, and because all the validation will be done again, and done
better, by `cl-typep' in the `initialize-instance' process. There's not
much reason to have a "pre-check", as errors are raised in both cases.

4. This version goes slightly faster than the old one (admittedly,
probably just because it omits type-checking).

Persistence format isn't changed, so this should be backwards
compatible.

I suppose the removal of validation might not be welcome, but at least I
hope the function->generic change is acceptable.



In GNU Emacs 27.0.50 (build 13, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2017-11-30 built on slip
Repository revision: 3f3d98ee5851840228786390ee7dbf851d144eb8
[0001-Replace-eieio-persistent-convert-list-to-object-with.patch (text/x-diff, attachment)]

This bug report was last modified 4 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.