aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-12-12 23:04:00 +0100
committerMattias EngdegÄrd2019-12-12 23:47:25 +0100
commitf16766a0eb2a78b58a4856d31306fc37f913d70e (patch)
treed3be560c8aaf4f4d3a59b285e27aab224922bb33 /doc
parentd7efe98951730842db4fc136e3b631c5ee0d8a53 (diff)
downloademacs-f16766a0eb2a78b58a4856d31306fc37f913d70e.tar.gz
emacs-f16766a0eb2a78b58a4856d31306fc37f913d70e.zip
Use `or' instead of `union' for charset union in rx
Design change suggested by Stefan Monnier. * doc/lispref/searching.texi (Rx Constructs): * etc/NEWS: Document. * lisp/emacs-lisp/rx.el (rx--translate-or): Detect charset arguments. (rx--charset-p): New. (rx--translate-not, rx--charset-intervals, rx--translate-union): Change from `union' to `or'. (rx--translate-form, rx--builtin-forms, rx): Remove `union'. * test/lisp/emacs-lisp/rx-tests.el (rx-union, rx-def-in-union) (rx-intersection): Rename tests and change `union' to `or' and `|'.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/searching.texi22
1 files changed, 11 insertions, 11 deletions
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index bf18f80f63f..0c6c7cc68b5 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1214,20 +1214,19 @@ Corresponding string regexp: @samp{[@dots{}]}
1214@item @code{(not @var{charspec})} 1214@item @code{(not @var{charspec})}
1215@cindex @code{not} in rx 1215@cindex @code{not} in rx
1216Match a character not included in @var{charspec}. @var{charspec} can 1216Match a character not included in @var{charspec}. @var{charspec} can
1217be an @code{any}, @code{not}, @code{union}, @code{intersection}, 1217be an @code{any}, @code{not}, @code{or}, @code{intersection},
1218@code{syntax} or @code{category} form, or a character class.@* 1218@code{syntax} or @code{category} form, or a character class.
1219If @var{charspec} is an @code{or} form, its arguments have the same
1220restrictions as those of @code{intersection}; see below.@*
1219Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}}, 1221Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}},
1220@samp{\C@var{code}} 1222@samp{\C@var{code}}
1221 1223
1222@item @code{(union @var{charset}@dots{})} 1224@item @code{(intersection @var{charset}@dots{})}
1223@itemx @code{(intersection @var{charset}@dots{})}
1224@cindex @code{union} in rx
1225@cindex @code{intersection} in rx 1225@cindex @code{intersection} in rx
1226Match a character that matches the union or intersection, 1226Match a character included in all of the @var{charset}s.
1227respectively, of the @var{charset}s. Each @var{charset} can be an 1227Each @var{charset} can be an @code{any} form without character
1228@code{any} form without character classes, or a @code{union}, 1228classes, or an @code{intersection}, @code{or} or @code{not} form whose
1229@code{intersection} or @code{not} form whose arguments are also 1229arguments are also @var{charset}s.
1230@var{charset}s.
1231 1230
1232@item @code{not-newline}, @code{nonl} 1231@item @code{not-newline}, @code{nonl}
1233@cindex @code{not-newline} in rx 1232@cindex @code{not-newline} in rx
@@ -1591,7 +1590,8 @@ when they are used, not when they are defined.
1591User-defined forms are allowed wherever arbitrary @code{rx} 1590User-defined forms are allowed wherever arbitrary @code{rx}
1592expressions are expected; for example, in the body of a 1591expressions are expected; for example, in the body of a
1593@code{zero-or-one} form, but not inside @code{any} or @code{category} 1592@code{zero-or-one} form, but not inside @code{any} or @code{category}
1594forms. They are also allowed inside @code{not} forms. 1593forms. They are also allowed inside @code{not} and
1594@code{intersection} forms.
1595@end itemize 1595@end itemize
1596 1596
1597@defmac rx-define name [arglist] rx-form 1597@defmac rx-define name [arglist] rx-form