summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-04-07 18:54:40 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-04-07 18:54:40 -0700
commita2b3fea957440b8358d3632a4a05e41dee964b5d (patch)
treea6ef4cf0ba807dfad9ae91b4bfde1935dc999a5f /lisp/emacs-lisp
parenta614cd416c5dd71702428a008992589395a722fc (diff)
downloademacs-a2b3fea957440b8358d3632a4a05e41dee964b5d.tar.gz
emacs-a2b3fea957440b8358d3632a4a05e41dee964b5d.tar.bz2
emacs-a2b3fea957440b8358d3632a4a05e41dee964b5d.zip
Deprecate copy-record in favor of copy-sequence
Since copy-sequence seems to be needed anyway for records, have it work on records, and remove copy-record as being superfluous. * doc/lispref/records.texi (Records, Record Functions): * lisp/emacs-lisp/cl-macs.el (cl-defstruct): * lisp/emacs-lisp/eieio.el (make-instance, clone): * test/src/alloc-tests.el (record-3): Use copy-sequence, not copy-record, to copy records. * doc/lispref/sequences.texi (Sequence Functions) (Array Functions): Document that aref and copy-sequence work on records. * etc/NEWS: Omit copy-record. * src/alloc.c (Fcopy_record): Remove. * src/data.c (Faref): Document that arg can be a record. * src/fns.c (Fcopy_sequence): Copy records, too.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el3
-rw-r--r--lisp/emacs-lisp/eieio.el6
2 files changed, 4 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 25c9f999920..ecb89fd51d7 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2808,8 +2808,7 @@ non-nil value, that slot cannot be set via `setf'.
(setq slots (nreverse slots)
defaults (nreverse defaults))
(and copier
- (push `(defalias ',copier
- ,(if (null type) '#'copy-record '#'copy-sequence))
+ (push `(defalias ',copier #'copy-sequence)
forms))
(if constructor
(push (list constructor
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 858b2fdaa04..e21d46e5289 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -699,8 +699,8 @@ SLOTS are the initialization slots used by `initialize-instance'.
This static method is called when an object is constructed.
It allocates the vector used to represent an EIEIO object, and then
calls `initialize-instance' on that object."
- (let* ((new-object (copy-record (eieio--class-default-object-cache
- (eieio--class-object class)))))
+ (let* ((new-object (copy-sequence (eieio--class-default-object-cache
+ (eieio--class-object class)))))
(if (and slots
(let ((x (car slots)))
(or (stringp x) (null x))))
@@ -804,7 +804,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-record obj)))
+ (let ((nobj (copy-sequence obj)))
(if (stringp (car params))
(funcall (if eieio-backward-compatibility #'ignore #'message)
"Obsolete name %S passed to clone" (pop params)))