]> git.eshelyaron.com Git - emacs.git/commit
* lisp/emacs-lisp/pcase.el: Bind all the vars in `or` patterns
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 2 Mar 2021 04:57:34 +0000 (23:57 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 2 Mar 2021 04:57:56 +0000 (23:57 -0500)
commit165353674e5fe7109ba9cbf526de0333902b7851
tree8a119ab22fb363ef06f37fd13ab85d29a7399929
parentbac0089fb8b15b71bd4bde00f6fd8e1c4b9fbd1d
* lisp/emacs-lisp/pcase.el: Bind all the vars in `or` patterns

Improve the handling of `or` patterns where not all sub-patterns bind the
same set of variables.  This used to be "unsupported" and behaved in
somewhat unpredictable ways.

(pcase--expand): Rewrite.
(pcase-codegen): Delete.

* doc/lispref/control.texi (pcase Macro): Adjust accordingly.
Also remove the warning about "at least two" sub patterns.
These work fine, AFAICT, and if not we should fix it.

* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-or-vars): New test.
doc/lispref/control.texi
etc/NEWS
lisp/emacs-lisp/pcase.el
test/lisp/emacs-lisp/pcase-tests.el