diff options
| author | Mattias EngdegÄrd | 2020-02-13 20:06:48 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2020-02-13 20:43:42 +0100 |
| commit | 9f6a4bbcc96bef451c75a8a78e442dec87a0ddf0 (patch) | |
| tree | bde1d7ad47c8cea91a80c4391593515b3fd0d2ea /doc/lispref | |
| parent | d1e8ce8bb6fadf3d034ae437ff1c1b81be7d5209 (diff) | |
| download | emacs-9f6a4bbcc96bef451c75a8a78e442dec87a0ddf0.tar.gz emacs-9f6a4bbcc96bef451c75a8a78e442dec87a0ddf0.zip | |
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')
| -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. | |||
| 1745 | @end defun | 1745 | @end defun |
| 1746 | 1746 | ||
| 1747 | @cindex optimize regexp | 1747 | @cindex optimize regexp |
| 1748 | @defun regexp-opt strings &optional paren keep-order | 1748 | @defun regexp-opt strings &optional paren |
| 1749 | This function returns an efficient regular expression that will match | 1749 | This function returns an efficient regular expression that will match |
| 1750 | any of the strings in the list @var{strings}. This is useful when you | 1750 | any of the strings in the list @var{strings}. This is useful when you |
| 1751 | need to make matching or searching as fast as possible---for example, | 1751 | 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 | |||
| 1783 | it will apply to the whole expression. | 1783 | it will apply to the whole expression. |
| 1784 | @end table | 1784 | @end table |
| 1785 | 1785 | ||
| 1786 | The optional argument @var{keep-order}, if non-@code{nil}, forces the | 1786 | The returned regexp is ordered in such a way that it will always match |
| 1787 | match to be performed in the order given, as if the strings were made | 1787 | the longest string possible. |
| 1788 | into a regexp by joining them with the @samp{\|} operator. If nil or | ||
| 1789 | omitted, the returned regexp will always match the longest string | ||
| 1790 | possible. | ||
| 1791 | 1788 | ||
| 1792 | Up to reordering, the resulting regexp of @code{regexp-opt} is | 1789 | Up to reordering, the resulting regexp of @code{regexp-opt} is |
| 1793 | equivalent to but usually more efficient than that of a simplified | 1790 | equivalent to but usually more efficient than that of a simplified |