]> git.eshelyaron.com Git - emacs.git/commitdiff
More precise 'regexp-opt' documentation
authorMattias Engdegård <mattiase@acm.org>
Sun, 15 Dec 2019 21:17:11 +0000 (22:17 +0100)
committerMattias Engdegård <mattiase@acm.org>
Wed, 18 Dec 2019 11:46:30 +0000 (12:46 +0100)
* 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.

doc/lispref/searching.texi
lisp/emacs-lisp/regexp-opt.el

index 700880c2289e501ebc00b295f248e68485385569..c8d263d972ede3fc2e9d37b9853e2fe4cedbff8e 100644 (file)
@@ -1780,11 +1780,11 @@ 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 @code{nil} or omitted,
-allows the returned regexp to match the strings in any order.  If
-non-@code{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 @samp{\|} operator.
+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.
 
 Up to reordering, the resulting regexp of @code{regexp-opt} is
 equivalent to but usually more efficient than that of a simplified
index ab52003cdf749746a4c0285f6ea1af9bb1db713c..c0921646d65fac151a4fec119d53700fe2bda0dc 100644 (file)
@@ -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: