diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-02-13 20:06:48 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-02-13 20:43:42 +0100 |
commit | 9f6a4bbcc96bef451c75a8a78e442dec87a0ddf0 (patch) | |
tree | bde1d7ad47c8cea91a80c4391593515b3fd0d2ea /doc/lispref/searching.texi | |
parent | d1e8ce8bb6fadf3d034ae437ff1c1b81be7d5209 (diff) | |
download | emacs-9f6a4bbcc96bef451c75a8a78e442dec87a0ddf0.tar.gz |
Remove the optional KEEP-ORDER argument to regexp-opt
This argument was added for the 'or' clause in rx, but it turned out
to be a bad idea (bug#37659), and there seems to be little other use
for it.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt): Remove KEEP-ORDER.
* doc/lispref/searching.texi (Regexp Functions):
* etc/NEWS: Remove it from the documentation.
* test/lisp/emacs-lisp/regexp-opt-tests.el (regexp-opt-test--match-all)
(regexp-opt-test--check-perm, regexp-opt-test--explain-perm)
(regexp-opt-keep-order, regexp-opt-longest-match): Simplify test.
Diffstat (limited to 'doc/lispref/searching.texi')
-rw-r--r-- | doc/lispref/searching.texi | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 5f4509a8b43..1f6db0643e8 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1745,7 +1745,7 @@ any special characters. @end defun @cindex optimize regexp -@defun regexp-opt strings &optional paren keep-order +@defun regexp-opt strings &optional paren This function returns an efficient regular expression that will match any of the strings in the list @var{strings}. This is useful when you need to make matching or searching as fast as possible---for example, @@ -1783,11 +1783,8 @@ if it is necessary to ensure that a postfix operator appended to it will apply to the whole expression. @end table -The optional argument @var{keep-order}, if non-@code{nil}, forces the -match to be performed in the order given, as if the strings were made -into a regexp by joining them with the @samp{\|} operator. If nil or -omitted, the returned regexp will always match the longest string -possible. +The returned regexp is ordered in such a way that it will always match +the longest string possible. Up to reordering, the resulting regexp of @code{regexp-opt} is equivalent to but usually more efficient than that of a simplified |