1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Make let-alist work with vectors

* lisp/emacs-lisp/let-alist.el (let-alist--deep-dot-search):
Descend into vectors, too, looking for dotted variables (bug#23244).

Test case:

(let-alist '((a . 1) (b . 2))
  `[,(+ .a) ,(+ .a .b .b)])
This commit is contained in:
Lars Ingebrigtsen 2019-07-28 23:28:18 +02:00
parent 776872766c
commit d7665ae8df
2 changed files with 7 additions and 0 deletions

View file

@ -75,6 +75,8 @@ symbol, and each cdr is the same symbol without the `.'."
;; Return the cons cell inside a list, so it can be appended
;; with other results in the clause below.
(list (cons data (intern (replace-match "" nil nil name)))))))
((vectorp data)
(apply #'nconc (mapcar #'let-alist--deep-dot-search data)))
((not (consp data)) nil)
((eq (car data) 'let-alist)
;; For nested let-alist forms, ignore symbols appearing in the