diff options
| author | Mattias EngdegÄrd | 2019-12-12 23:04:00 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-12-12 23:47:25 +0100 |
| commit | f16766a0eb2a78b58a4856d31306fc37f913d70e (patch) | |
| tree | d3be560c8aaf4f4d3a59b285e27aab224922bb33 /doc | |
| parent | d7efe98951730842db4fc136e3b631c5ee0d8a53 (diff) | |
| download | emacs-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.texi | 22 |
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 |
| 1216 | Match a character not included in @var{charspec}. @var{charspec} can | 1216 | Match a character not included in @var{charspec}. @var{charspec} can |
| 1217 | be an @code{any}, @code{not}, @code{union}, @code{intersection}, | 1217 | be 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. |
| 1219 | If @var{charspec} is an @code{or} form, its arguments have the same | ||
| 1220 | restrictions as those of @code{intersection}; see below.@* | ||
| 1219 | Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}}, | 1221 | Corresponding 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 |
| 1226 | Match a character that matches the union or intersection, | 1226 | Match a character included in all of the @var{charset}s. |
| 1227 | respectively, of the @var{charset}s. Each @var{charset} can be an | 1227 | Each @var{charset} can be an @code{any} form without character |
| 1228 | @code{any} form without character classes, or a @code{union}, | 1228 | classes, or an @code{intersection}, @code{or} or @code{not} form whose |
| 1229 | @code{intersection} or @code{not} form whose arguments are also | 1229 | arguments 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. | |||
| 1591 | User-defined forms are allowed wherever arbitrary @code{rx} | 1590 | User-defined forms are allowed wherever arbitrary @code{rx} |
| 1592 | expressions are expected; for example, in the body of a | 1591 | expressions 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} |
| 1594 | forms. They are also allowed inside @code{not} forms. | 1593 | forms. 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 |