Commit 2a54e8df authored by NicolasPetton's avatar NicolasPetton

Better syntax for the map pcase pattern

* lisp/emacs-lisp/map.el: Improves the map pcase pattern to take
bindings of the form (KEY PAT) or SYMBOL. KEY is not quoted.
parent cd22663b
......@@ -360,7 +360,7 @@ If KEY is not found, return DEFAULT which defaults to nil."
"Return a list of pcase bindings from ARGS to the elements of a map."
(seq-map (lambda (elt)
(if (consp elt)
`(app (pcase--flip map-elt ',(car elt)) ,(cdr elt))
`(app (pcase--flip map-elt ,(car elt)) ,(cadr elt))
`(app (pcase--flip map-elt ',elt) ,elt)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment