]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename regexp-opt argument noreorder to keep-order
authorMattias Engdegård <mattiase@acm.org>
Wed, 6 Mar 2019 21:50:36 +0000 (22:50 +0100)
committerMattias Engdegård <mattiase@acm.org>
Wed, 6 Mar 2019 21:52:43 +0000 (22:52 +0100)
* doc/lispref/searching.texi (Regular Expression Functions):
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
Rename newly added `noreorder' argument to `keep-order', to avoid a
negative in the name.  Suggested by Phil Sainty (Bug#34641).

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

index 38e620405505b2264054018085cb738ce2c18d3c..740be2a31ff59599c159f98816d2a054814e21cf 100644 (file)
@@ -950,7 +950,7 @@ whitespace:
 @end defun
 
 @cindex optimize regexp
-@defun regexp-opt strings &optional paren noreorder
+@defun regexp-opt strings &optional paren keep-order
 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,
@@ -988,7 +988,7 @@ 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{noreorder}, if @code{nil} or omitted,
+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
index 4404b905a6f74e0cc38932a05e5e3c379c0f661e..fce6a47d9892225399de632ea33c8a36c98240ca 100644 (file)
@@ -84,7 +84,7 @@
 ;;; Code:
 
 ;;;###autoload
-(defun regexp-opt (strings &optional paren noreorder)
+(defun regexp-opt (strings &optional paren keep-order)
   "Return a regexp to match a string in the list STRINGS.
 Each string should be unique in STRINGS and should not contain
 any regexps, quoted or not.  Optional PAREN specifies how the
@@ -114,7 +114,7 @@ nil
     necessary to ensure that a postfix operator appended to it will
     apply to the whole expression.
 
-The optional argument NOREORDER, if nil or omitted, allows the
+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
@@ -149,7 +149,7 @@ usually more efficient than that of a simplified version:
               (concat (or open "\\(?:") "a\\`\\)"))
              ;; If we cannot reorder, give up all attempts at
              ;; optimisation.  There is room for improvement (Bug#34641).
-             ((and noreorder (regexp-opt--contains-prefix sorted-strings))
+             ((and keep-order (regexp-opt--contains-prefix sorted-strings))
               (concat (or open "\\(?:")
                       (mapconcat #'regexp-quote strings "\\|")
                       "\\)"))