emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/record 089a61f: Fix cl-defstruct and clone to use


From: Lars Brinkhoff
Subject: [Emacs-diffs] scratch/record 089a61f: Fix cl-defstruct and clone to use copy-record.
Date: Fri, 17 Mar 2017 06:53:14 -0400 (EDT)

branch: scratch/record
commit 089a61fa9755bd31fd1fc769842e27e3d1aec24d
Author: Lars Brinkhoff <address@hidden>
Commit: Lars Brinkhoff <address@hidden>

    Fix cl-defstruct and clone to use copy-record.
---
 lisp/emacs-lisp/cl-macs.el | 4 +++-
 lisp/emacs-lisp/eieio.el   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 6f00f29..7e08ca2 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2808,7 +2808,9 @@ non-nil value, that slot cannot be set via `setf'.
     (setq slots (nreverse slots)
          defaults (nreverse defaults))
     (and copier
-         (push `(defalias ',copier #'copy-sequence) forms))
+         (push `(defalias ',copier
+                    ,(if (null type) '#'copy-record '#'copy-sequence))
+               forms))
     (if constructor
        (push (list constructor
                     (cons '&key (delq nil (copy-sequence slots))))
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 8be24f2..f3530ca 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -806,7 +806,7 @@ first and modify the returned object.")
 
 (cl-defmethod clone ((obj eieio-default-superclass) &rest params)
   "Make a copy of OBJ, and then apply PARAMS."
-  (let ((nobj (copy-sequence obj)))
+  (let ((nobj (copy-record obj)))
     (if (stringp (car params))
         (funcall (if eieio-backward-compatibility #'ignore #'message)
                  "Obsolete name %S passed to clone" (pop params)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]