mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(lib): 'unknown specializer record' error on Emacs <30
Seems the 'record' specializer wasn't introduced until Emacs 30, so users on earlier versions will see this error on startup. Fix: #8186
This commit is contained in:
@ -331,19 +331,17 @@ TRIGGER-HOOK is a list of quoted hooks and/or sharp-quoted functions."
|
|||||||
;;
|
;;
|
||||||
;;; Deep copying
|
;;; Deep copying
|
||||||
|
|
||||||
(cl-defgeneric doom-copy (val &optional _deep?)
|
(cl-defgeneric doom-copy (val &optional deep?)
|
||||||
"Return a (optionally deep) copy of VAL."
|
"Return a (optionally deep) copy of VAL."
|
||||||
(cl-check-type val (or integer float boolean symbol null))
|
(if (recordp val) ; `record' specializer not supported until Emacs 30
|
||||||
val)
|
(if deep?
|
||||||
|
(cl-loop with newval = (copy-sequence val)
|
||||||
(cl-defmethod doom-copy ((val record) &optional deep?)
|
for idx from 1 to (length (cdr (cl-struct-slot-info (type-of val))))
|
||||||
"Return a (optionally deep) copy of record VAL."
|
do (aset newval idx (doom-copy (aref newval idx) t))
|
||||||
(if deep?
|
finally return newval)
|
||||||
(cl-loop with newval = (copy-sequence val)
|
(copy-sequence val))
|
||||||
for idx from 1 to (length (cdr (cl-struct-slot-info (type-of val))))
|
(cl-check-type val (or integer float boolean symbol null))
|
||||||
do (aset newval idx (doom-copy (aref newval idx) t))
|
val))
|
||||||
finally return newval)
|
|
||||||
(copy-sequence val)))
|
|
||||||
|
|
||||||
(cl-defmethod doom-copy ((val sequence) &optional deep?)
|
(cl-defmethod doom-copy ((val sequence) &optional deep?)
|
||||||
"Return a (optionally deep) copy of sequence VAL."
|
"Return a (optionally deep) copy of sequence VAL."
|
||||||
|
Reference in New Issue
Block a user