]> git.eshelyaron.com Git - emacs.git/commit
Add `union' and `intersection' to rx (bug#37849)
authorMattias Engdegård <mattiase@acm.org>
Fri, 6 Dec 2019 21:23:57 +0000 (22:23 +0100)
committerMattias Engdegård <mattiase@acm.org>
Tue, 10 Dec 2019 21:37:47 +0000 (22:37 +0100)
commitea93326cc046cb1beb7535cdf6d69b216b767685
tree5494bab812fdaf3f7a2997cb70926bdf6ec13993
parent9546a2a0d6653a7d930cda722f5babbebb0a1d0c
Add `union' and `intersection' to rx (bug#37849)

These character set operations, together with `not' for set
complement, improve the compositionality of rx, and reduce duplication
in complicated cases.  Named character classes are not permitted in
set operations.

* lisp/emacs-lisp/rx.el (rx--translate-any): Split into multiple
functions.
(rx--foldl, rx--parse-any, rx--generate-alt, rx--intervals-to-alt)
(rx--complement-intervals, rx--intersect-intervals)
(rx--union-intervals, rx--charset-intervals, rx--charset-union)
(rx--charset-all, rx--charset-intersection, rx--translate-union)
(rx--translate-intersection): New.
(rx--translate-not, rx--translate-form, rx--builtin-forms, rx):
Add `union' and `intersection'.
* test/lisp/emacs-lisp/rx-tests.el (rx-union ,rx-def-in-union)
(rx-intersection, rx-def-in-intersection): New tests.
* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS:
Document `union' and `intersection'.
doc/lispref/searching.texi
etc/NEWS
lisp/emacs-lisp/rx.el
test/lisp/emacs-lisp/rx-tests.el