unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28587: 26.0.60; Don't write object name strings in object-write method
@ 2017-09-24 21:11 Eric Abrahamsen
  2017-10-22  3:29 ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Abrahamsen @ 2017-09-24 21:11 UTC (permalink / raw)
  To: 28587

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Do-not-print-object-name-string-in-object-write-meth.patch --]
[-- Type: text/x-diff, Size: 1843 bytes --]

From 77a270ec916854ecb7e9ccaca444fe8ccbeab843 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Sun, 24 Sep 2017 14:07:26 -0700
Subject: [PATCH] Do not print object name string in object-write method

* lisp/emacs-lisp/eieio.el (object-write): The object name string is
  obsolete, might as well save some bytes.
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-convert-list-to-object):
  Check for presence of object name string, and ignore.
---
 lisp/emacs-lisp/eieio-base.el | 7 +++++--
 lisp/emacs-lisp/eieio.el      | 2 --
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 6b39b4f262..4c6fbae12c 100644
--- 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
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))
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-22 22:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).