aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2019-03-07 16:19:00 +0200
committerEli Zaretskii2019-03-07 16:19:00 +0200
commit953cbce77be9a8da1cbf0ca5ee6442923478e186 (patch)
tree578ee0cc4c4314df07913d5b790ab89ab50a123b /lisp
parenta0b2a5ad9ec8186b679ee80e1c5b9786672344a0 (diff)
parent3fd2100bff58008b1eaf48922539d914c6ce6c16 (diff)
downloademacs-953cbce77be9a8da1cbf0ca5ee6442923478e186.tar.gz
emacs-953cbce77be9a8da1cbf0ca5ee6442923478e186.zip
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/regexp-opt.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index 4404b905a6f..fce6a47d989 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -84,7 +84,7 @@
84;;; Code: 84;;; Code:
85 85
86;;;###autoload 86;;;###autoload
87(defun regexp-opt (strings &optional paren noreorder) 87(defun regexp-opt (strings &optional paren keep-order)
88 "Return a regexp to match a string in the list STRINGS. 88 "Return a regexp to match a string in the list STRINGS.
89Each string should be unique in STRINGS and should not contain 89Each string should be unique in STRINGS and should not contain
90any regexps, quoted or not. Optional PAREN specifies how the 90any regexps, quoted or not. Optional PAREN specifies how the
@@ -114,7 +114,7 @@ nil
114 necessary to ensure that a postfix operator appended to it will 114 necessary to ensure that a postfix operator appended to it will
115 apply to the whole expression. 115 apply to the whole expression.
116 116
117The optional argument NOREORDER, if nil or omitted, allows the 117The optional argument KEEP-ORDER, if nil or omitted, allows the
118returned regexp to match the strings in any order. If non-nil, 118returned regexp to match the strings in any order. If non-nil,
119the match is guaranteed to be performed in the order given, as if 119the match is guaranteed to be performed in the order given, as if
120the strings were made into a regexp by joining them with the 120the strings were made into a regexp by joining them with the
@@ -149,7 +149,7 @@ usually more efficient than that of a simplified version:
149 (concat (or open "\\(?:") "a\\`\\)")) 149 (concat (or open "\\(?:") "a\\`\\)"))
150 ;; If we cannot reorder, give up all attempts at 150 ;; If we cannot reorder, give up all attempts at
151 ;; optimisation. There is room for improvement (Bug#34641). 151 ;; optimisation. There is room for improvement (Bug#34641).
152 ((and noreorder (regexp-opt--contains-prefix sorted-strings)) 152 ((and keep-order (regexp-opt--contains-prefix sorted-strings))
153 (concat (or open "\\(?:") 153 (concat (or open "\\(?:")
154 (mapconcat #'regexp-quote strings "\\|") 154 (mapconcat #'regexp-quote strings "\\|")
155 "\\)")) 155 "\\)"))