]> git.eshelyaron.com Git - emacs.git/commit
Support numeric indexing in let-alist
authorSpencer Baugh <sbaugh@janestreet.com>
Thu, 12 Oct 2023 22:01:46 +0000 (18:01 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Sep 2024 10:45:16 +0000 (12:45 +0200)
commita3fa283e3fa982754c001ceb391373a45cc17287
tree508e3f6959eeae9d6f63ffbef458ce71af599140
parent04a82aaedaa7ad69c7b0f3a61d4dfacd99008dfa
Support numeric indexing in let-alist

let-alist is very useful.  But sometimes an alist contains a list in
the middle, which contains yet more alists.  Previously, this was
somewhat painful to deal with, and required something like:

(let-alist alist
  (let-alist (nth 0 .a)
    (let-alist (nth 3 .b)
       .c)))

Now, the following works:

(let-alist alist
  .a.0.b.3.c)

* lisp/emacs-lisp/let-alist.el (let-alist--access-sexp): Properly
parse numbers to handle lists.  (Bug#66509)
(let-alist--list-to-sexp): Use nth to handle numbers.
(let-alist): Update docs.

(cherry picked from commit ae4171efdc60dfa53aa404e5926f5165dbf98d59)
lisp/emacs-lisp/let-alist.el