unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: 28587@debbugs.gnu.org
Subject: bug#28587: 26.0.60; Don't write object name strings in object-write method
Date: Sat, 21 Oct 2017 23:29:00 -0400	[thread overview]
Message-ID: <jwvlgk3lv7i.fsf-monnier+bug#28587@gnu.org> (raw)
In-Reply-To: <87efqvg5tw.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 24 Sep 2017 14:11:23 -0700")

> 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





  reply	other threads:[~2017-10-22  3:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-24 21:11 bug#28587: 26.0.60; Don't write object name strings in object-write method Eric Abrahamsen
2017-10-22  3:29 ` Stefan Monnier [this message]
2017-11-08 20:01   ` Eric Abrahamsen
2017-11-08 20:31     ` Stefan Monnier
2017-11-08 21:01       ` Eric Abrahamsen
2017-11-08 22:05         ` Stefan Monnier
2017-11-08 22:08           ` Eric Abrahamsen
2017-11-11  1:39           ` Eric Abrahamsen
2017-11-22 22:30           ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwvlgk3lv7i.fsf-monnier+bug#28587@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=28587@debbugs.gnu.org \
    --cc=eric@ericabrahamsen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).