From d547f417c89d92267ddeff296a81a68c36d64c4d Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 18 Nov 2017 10:18:53 -0800 Subject: [PATCH] Further fixes to writing of object names Pursuant to 1ef6d2b0e6 * lisp/emacs-lisp/eieio.el (object-write): Only write the name in the comment when the comment's also present. Newline should only be printed if the name is. --- lisp/emacs-lisp/eieio.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index 9276fab0c39..d0d2ff5145c 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -868,7 +868,7 @@ This writes out the vector version of this object. Complex and recursive object are discouraged from being written. If optional COMMENT is non-nil, include comments when outputting this object." - (when eieio-print-object-name + (when (and comment eieio-print-object-name) (princ ";; Object ") (princ (eieio-object-name-string this)) (princ "\n")) @@ -887,8 +887,8 @@ this object." (princ (symbol-name (eieio--class-constructor (eieio-object-class this)))) (when eieio-print-object-name (princ " ") - (prin1 (eieio-object-name-string this))) - (princ "\n") + (prin1 (eieio-object-name-string this)) + (princ "\n")) ;; Loop over all the public slots (let ((slots (eieio--class-slots cv)) (eieio-print-depth (1+ eieio-print-depth))) -- 2.39.5