summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-02-25 15:22:02 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2019-03-02 16:22:37 +0100
commit7bda34af52687440632127b4b79986e951b978b1 (patch)
treebe661e3d387f6bea5043746309b7d337da9e9014 /etc
parentda758046da74e33273265cd2e72a8aa1a0c9c7e3 (diff)
downloademacs-7bda34af52687440632127b4b79986e951b978b1.tar.gz
Correct regexp-opt return value for empty string list
When regexp-opt is called with an empty list of strings, return a regexp that doesn't match anything instead of the empty string (Bug#20307). * doc/lispref/searching.texi (Regular Expression Functions): * etc/NEWS: Document the new behaviour. * lisp/emacs-lisp/regexp-opt.el (regexp-opt): Return a never-match regexp for empty inputs.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 7c95988ff52..65eb9ba1af2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1649,6 +1649,12 @@ in any order. If the new third argument is 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 function 'regexp-opt', when given an empty list of strings, now
+returns a regexp that never matches anything, which is an identity for
+this operation. Previously, the empty string was returned in this
+case.
+
* Changes in Emacs 27.1 on Non-Free Operating Systems