summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-06-26 12:20:11 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2021-06-26 12:20:25 -0400
commit73663d14cfb3923dc57fab0043f7b1aa3a488407 (patch)
treecca10d0423ef63c67da3b67ed42bf9440d0c0519 /lisp/emacs-lisp
parentd4561201891a53b7536fae98862b04535a1489c4 (diff)
downloademacs-73663d14cfb3923dc57fab0043f7b1aa3a488407.tar.gz
emacs-73663d14cfb3923dc57fab0043f7b1aa3a488407.tar.bz2
emacs-73663d14cfb3923dc57fab0043f7b1aa3a488407.zip
* lisp/emacs-lisp/cl-macs.el: Fix test regression
(cl--alist-to-plist): New function. (cl-struct-slot-info): Use it.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index a59d42e673c..cff43689405 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -3276,6 +3276,13 @@ STRUCT-TYPE is a symbol naming a struct type. Return `record',
(declare (side-effect-free t) (pure t))
(cl--struct-class-type (cl--struct-get-class struct-type)))
+(defun cl--alist-to-plist (alist)
+ (let ((res '()))
+ (dolist (x alist)
+ (push (car x) res)
+ (push (cdr x) res))
+ (nreverse res)))
+
(defun cl-struct-slot-info (struct-type)
"Return a list of slot names of struct STRUCT-TYPE.
Each entry is a list (SLOT-NAME . OPTS), where SLOT-NAME is a
@@ -3293,7 +3300,7 @@ slots skipped by :initial-offset may appear in the list."
,(cl--slot-descriptor-initform slot)
,@(if (not (eq (cl--slot-descriptor-type slot) t))
`(:type ,(cl--slot-descriptor-type slot)))
- ,@(cl--slot-descriptor-props slot))
+ ,@(cl--alist-to-plist (cl--slot-descriptor-props slot)))
descs)))
(nreverse descs)))