changeset 95267:4ec6f3d46f27

(regexp-opt): Always return a properly-grouped regexp.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 23 May 2008 17:19:22 +0000
parents 9360d63720be
children bcc553c768f9
files lisp/ChangeLog lisp/emacs-lisp/regexp-opt.el
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri May 23 15:31:17 2008 +0000
+++ b/lisp/ChangeLog	Fri May 23 17:19:22 2008 +0000
@@ -1,3 +1,8 @@
+2008-05-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/regexp-opt.el (regexp-opt): Always return
+	a properly-grouped regexp.
+
 2008-05-23  Juanma Barranquero  <lekktu@gmail.com>
 
 	* progmodes/cap-words.el (capitalized-words-mode):
--- a/lisp/emacs-lisp/regexp-opt.el	Fri May 23 15:31:17 2008 +0000
+++ b/lisp/emacs-lisp/regexp-opt.el	Fri May 23 17:19:22 2008 +0000
@@ -107,7 +107,7 @@
 	   (open (cond ((stringp paren) paren) (paren "\\(")))
 	   (sorted-strings (delete-dups
 			    (sort (copy-sequence strings) 'string-lessp)))
-	   (re (regexp-opt-group sorted-strings open)))
+	   (re (regexp-opt-group sorted-strings (or open t) (not open))))
       (if words (concat "\\<" re "\\>") re))))
 
 ;;;###autoload