aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMattias EngdegÄrd2019-12-13 13:10:58 +0100
committerMattias EngdegÄrd2019-12-13 13:30:14 +0100
commit82b4e48c590cf2c0448a751e641b0ee7a6a02438 (patch)
tree55da830604ce9ebe4a5aa626bec285fb688578a3 /doc
parentb04086adf649b18cf5309dd43aa638fc7b3cd4a0 (diff)
downloademacs-82b4e48c590cf2c0448a751e641b0ee7a6a02438.tar.gz
emacs-82b4e48c590cf2c0448a751e641b0ee7a6a02438.zip
Allow characters and single-char strings in rx charsets
The `not' and `intersection' forms, and `or' inside these forms, now accept characters and single-character strings as arguments. Previously, they had to be wrapped in `any' forms. This does not add expressive power but is a convenience and is easily understood. * doc/lispref/searching.texi (Rx Constructs): Amend the documentation. * etc/NEWS: Announce the change. * lisp/emacs-lisp/rx.el (rx--charset-p, rx--translate-not) (rx--charset-intervals, rx): Accept characters and 1-char strings in more places. * test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-charset-or) (rx-def-in-charset-or, rx-intersection): Test the change.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/searching.texi11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 0c6c7cc68b5..700880c2289 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1214,8 +1214,9 @@ 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{or}, @code{intersection}, 1217be a character, a single-character string, an @code{any}, @code{not},
1218@code{syntax} or @code{category} form, or a character class. 1218@code{or}, @code{intersection}, @code{syntax} or @code{category} form,
1219or a character class.
1219If @var{charspec} is an @code{or} form, its arguments have the same 1220If @var{charspec} is an @code{or} form, its arguments have the same
1220restrictions as those of @code{intersection}; see below.@* 1221restrictions as those of @code{intersection}; see below.@*
1221Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}}, 1222Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}},
@@ -1224,9 +1225,9 @@ Corresponding string regexp: @samp{[^@dots{}]}, @samp{\S@var{code}},
1224@item @code{(intersection @var{charset}@dots{})} 1225@item @code{(intersection @var{charset}@dots{})}
1225@cindex @code{intersection} in rx 1226@cindex @code{intersection} in rx
1226Match a character included in all of the @var{charset}s. 1227Match a character included in all of the @var{charset}s.
1227Each @var{charset} can be an @code{any} form without character 1228Each @var{charset} can be a character, a single-character string, an
1228classes, or an @code{intersection}, @code{or} or @code{not} form whose 1229@code{any} form without character classes, or an @code{intersection},
1229arguments are also @var{charset}s. 1230@code{or} or @code{not} form whose arguments are also @var{charset}s.
1230 1231
1231@item @code{not-newline}, @code{nonl} 1232@item @code{not-newline}, @code{nonl}
1232@cindex @code{not-newline} in rx 1233@cindex @code{not-newline} in rx