GNU bug report logs -
#28587
26.0.60; Don't write object name strings in object-write method
Previous Next
Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Date: Sun, 24 Sep 2017 21:12:02 UTC
Severity: minor
Tags: patch
Found in version 26.0.60
Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28587 in the body.
You can then email your comments to 28587 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Sun, 24 Sep 2017 21:12:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 24 Sep 2017 21:12:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
If we're going to ignore them, we might as well not write them to begin
with.
Are there any other places that expect the presence of this name string?
In GNU Emacs 26.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.21)
of 2017-09-22 built on clem
Repository revision: 908af46abdb2c19ff3c72543e4fadf8e0ed82d2b
[0001-Do-not-print-object-name-string-in-object-write-meth.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Sun, 22 Oct 2017 03:30:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 28587 <at> debbugs.gnu.org (full text, mbox):
> If we're going to ignore them, we might as well not write them to begin
> with.
Agreed.
> --- a/lisp/emacs-lisp/eieio-base.el
> +++ b/lisp/emacs-lisp/eieio-base.el
> @@ -255,8 +255,11 @@ eieio-persistent-convert-list-to-object
> Note: This function recurses when a slot of :type of some object is
> identified, and needing more object creation."
> (let* ((objclass (nth 0 inputlist))
> - ;; (objname (nth 1 inputlist))
> - (slots (nthcdr 2 inputlist))
> + ;; Earlier versions of `object-write' added a string name for
> + ;; the object, now obsolete.
> + (slots (nthcdr
> + (if (stringp (nth 1 inputlist)) 2 1)
> + inputlist))
> (createslots nil)
> (class
> (progn
This looks good, feel free to install it into `master'.
> diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
> index 75f1097acf..448d5e6fe2 100644
> --- a/lisp/emacs-lisp/eieio.el
> +++ b/lisp/emacs-lisp/eieio.el
> @@ -874,8 +874,6 @@ eieio-print-depth
> (princ (make-string (* eieio-print-depth 2) ? ))
> (princ "(")
> (princ (symbol-name (eieio--class-constructor (eieio-object-class this))))
> - (princ " ")
> - (prin1 (eieio-object-name-string this))
> (princ "\n")
> ;; Loop over all the public slots
> (let ((slots (eieio--class-slots cv))
This is more problematic since data generated with this hunk will be
incompatible with an Emacs which doesn't have the other hunk applied.
So I think this should be conditional on a defcustom and by default this
defcustom should cause the code to still behave as before.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Wed, 08 Nov 2017 20:04:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 28587 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 10/21/17 23:29 PM, Stefan Monnier wrote:
[...]
> This is more problematic since data generated with this hunk will be
> incompatible with an Emacs which doesn't have the other hunk applied.
> So I think this should be conditional on a defcustom and by default this
> defcustom should cause the code to still behave as before.
So where we're at now is, the previous chunk has gone into both master
and emacs-26. The next patch (below) would only go into master, so as to
be more conservative about what's emitted. Everything defaults to
current behavior.
This patch does two things: permits omission of the object name strings,
and permits shutting off indentation (which helps a lot for shrinking
the file size). In a previous version I had `eieio-print-depth' do
double duty as a boolean and an integer; this version has a separate
defvar for controlling whether indentation is printed at all.
`eieio-print-depth' still gets incremented; someone might find that
useful.
Eric
[0001-Provide-more-control-over-writing-of-objects-in-obje.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Wed, 08 Nov 2017 20:30:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 28587 <at> debbugs.gnu.org (full text, mbox):
> So where we're at now is, the previous chunk has gone into both master
> and emacs-26.
Yay!
> The next patch (below) would only go into master, so as to
> be more conservative about what's emitted. Everything defaults to
> current behavior.
Looks good, except for:
> + "When non-nil write the object name in `object-write'.
> +Does not affect objects subclassing `eieio-named'. Writing
> +object names is deprecated as of Emacs 24.4; consider setting
> +this to nil.")
AFAIK names are deprecated in calls to EIEIO constructors since
Emacs-25 (rather 24.4), and it's only since Emacs-26 that they are
optional in "eieio-presistent" written representations.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Wed, 08 Nov 2017 21:02:00 GMT)
Full text and
rfc822 format available.
Message #17 received at 28587 <at> debbugs.gnu.org (full text, mbox):
On 11/08/17 15:31 PM, Stefan Monnier wrote:
>> So where we're at now is, the previous chunk has gone into both master
>> and emacs-26.
>
> Yay!
>
>> The next patch (below) would only go into master, so as to
>> be more conservative about what's emitted. Everything defaults to
>> current behavior.
>
> Looks good, except for:
>
>> + "When non-nil write the object name in `object-write'.
>> +Does not affect objects subclassing `eieio-named'. Writing
>> +object names is deprecated as of Emacs 24.4; consider setting
>> +this to nil.")
>
> AFAIK names are deprecated in calls to EIEIO constructors since
> Emacs-25 (rather 24.4), and it's only since Emacs-26 that they are
> optional in "eieio-presistent" written representations.
Okay I see, I got a little confused there. I checked the emacs 25 branch
and it ignores an object name string (emacs 24 requires it), so maybe
the only important thing is to say:
"Note that prior to Emacs version 25 the object name is required."
How's that?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Wed, 08 Nov 2017 22:05:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 28587 <at> debbugs.gnu.org (full text, mbox):
>> AFAIK names are deprecated in calls to EIEIO constructors since
>> Emacs-25 (rather 24.4), and it's only since Emacs-26 that they are
>> optional in "eieio-presistent" written representations.
> Okay I see, I got a little confused there. I checked the emacs 25 branch
> and it ignores an object name string (emacs 24 requires it), so maybe
> the only important thing is to say:
> "Note that prior to Emacs version 25 the object name is required."
I think the only important part is that Emacs<26 requires it (tho only
Emacs<25 makes actual use of it, and even then, this use is mostly
irrelevant, except maybe in corner cases in the course of debugging).
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Wed, 08 Nov 2017 22:11:01 GMT)
Full text and
rfc822 format available.
Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
>>> AFAIK names are deprecated in calls to EIEIO constructors since
>>> Emacs-25 (rather 24.4), and it's only since Emacs-26 that they are
>>> optional in "eieio-presistent" written representations.
>> Okay I see, I got a little confused there. I checked the emacs 25 branch
>> and it ignores an object name string (emacs 24 requires it), so maybe
>> the only important thing is to say:
>> "Note that prior to Emacs version 25 the object name is required."
>
> I think the only important part is that Emacs<26 requires it (tho only
> Emacs<25 makes actual use of it, and even then, this use is mostly
> irrelevant, except maybe in corner cases in the course of debugging).
Right! Bah, I keep getting this wrong. Emacs<26 will fail without it.
I'll make that note, and leave it at that.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#28587
; Package
emacs
.
(Sat, 11 Nov 2017 01:40:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 28587 <at> debbugs.gnu.org (full text, mbox):
On 11/08/17 17:05 PM, Stefan Monnier wrote:
>>> AFAIK names are deprecated in calls to EIEIO constructors since
>>> Emacs-25 (rather 24.4), and it's only since Emacs-26 that they are
>>> optional in "eieio-presistent" written representations.
>> Okay I see, I got a little confused there. I checked the emacs 25 branch
>> and it ignores an object name string (emacs 24 requires it), so maybe
>> the only important thing is to say:
>> "Note that prior to Emacs version 25 the object name is required."
>
> I think the only important part is that Emacs<26 requires it (tho only
> Emacs<25 makes actual use of it, and even then, this use is mostly
> irrelevant, except maybe in corner cases in the course of debugging).
Okay, there it goes, with a modified docstring. Tests are passing here;
if no one complains in the next couple days, I'll close this bug report.
Eric
Reply sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
You have taken responsibility.
(Wed, 22 Nov 2017 22:31:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
bug acknowledged by developer.
(Wed, 22 Nov 2017 22:31:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 28587-done <at> debbugs.gnu.org (full text, mbox):
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 21 Dec 2017 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 185 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.