summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/regexp-opt.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-12-15 22:17:11 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2019-12-18 12:46:30 +0100
commitd55f2f74f53910c4416be1e023771dc3a8142727 (patch)
treedf3918f8eb0b1c77dc2f2f4d6e6d6f3415ca0a2f /lisp/emacs-lisp/regexp-opt.el
parent0a10795d0bf4fe21997f907b7d6b1fe13517912b (diff)
downloademacs-d55f2f74f53910c4416be1e023771dc3a8142727.tar.gz
emacs-d55f2f74f53910c4416be1e023771dc3a8142727.tar.bz2
emacs-d55f2f74f53910c4416be1e023771dc3a8142727.zip
More precise 'regexp-opt' documentation
* lisp/emacs-lisp/regexp-opt.el (regexp-opt): * doc/lispref/searching.texi (Regexp Functions): Be more specific about how the KEEP-ORDER argument actually works. If nil, the regexp guarantees a longest match; this is the behaviour that many callers implicitly rely on.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
-rw-r--r--lisp/emacs-lisp/regexp-opt.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index ab52003cdf7..c0921646d65 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -114,11 +114,11 @@ nil
necessary to ensure that a postfix operator appended to it will
apply to the whole expression.
-The optional argument KEEP-ORDER, if nil or omitted, allows the
-returned regexp to match the strings in any order. If non-nil,
-the match is guaranteed to be performed in the order given, as if
-the strings were made into a regexp by joining them with the
-`\\|' operator.
+The optional argument KEEP-ORDER, if non-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 `\\|' operator. If nil or
+omitted, the returned regexp is will always match the longest
+string possible.
Up to reordering, the resulting regexp is equivalent to but
usually more efficient than that of a simplified version: