]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/regexp-opt.el
Add 2009 to copyright years.
[gnu-emacs] / lisp / emacs-lisp / regexp-opt.el
index 70f7141210db998b567458ecd047b32cf00b8736..75722c6dccbab4accbd66a88360f8e4752edb56b 100644 (file)
@@ -1,7 +1,7 @@
 ;;; regexp-opt.el --- generate efficient regexps to match strings
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;;   2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Simon Marshall <simon@gnu.org>
 ;; Maintainer: FSF
@@ -107,7 +107,7 @@ by \\=\\< and \\>."
           (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