mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
revert: fix(lib): doom-copy: copy first level of records
Shallow should mean shallow.
Revert: 82cfe98ccc
This commit is contained in:
parent
9b4f7ead88
commit
b31eef9336
1 changed files with 6 additions and 4 deletions
|
|
@ -331,10 +331,12 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
|
|||
(cl-defgeneric doom-copy (val &optional deep?)
|
||||
"Return a (optionally deep) copy of VAL."
|
||||
(if (recordp val) ; `record' specializer not supported until Emacs 30
|
||||
(cl-loop with newval = (copy-sequence val)
|
||||
for idx from 1 to (length (cdr (cl-struct-slot-info (type-of val))))
|
||||
do (aset newval idx (doom-copy (aref newval idx) deep?))
|
||||
finally return newval)
|
||||
(if deep?
|
||||
(cl-loop with newval = (copy-sequence val)
|
||||
for idx from 1 to (length (cdr (cl-struct-slot-info (type-of val))))
|
||||
do (aset newval idx (doom-copy (aref newval idx) t))
|
||||
finally return newval)
|
||||
(copy-sequence val))
|
||||
(cl-check-type val (or integer float boolean symbol null))
|
||||
val))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue