diff options
| author | Stefan Monnier | 2008-05-23 17:19:22 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-05-23 17:19:22 +0000 |
| commit | 9cc236e006e474dc83a90d0bb5bc5f6b99c9351e (patch) | |
| tree | 238d4ed54e268a1cd91c090d40299a107f42bcab | |
| parent | f05cde180d893a81e41f27b0a4cfbfb38de3f752 (diff) | |
| download | emacs-9cc236e006e474dc83a90d0bb5bc5f6b99c9351e.tar.gz emacs-9cc236e006e474dc83a90d0bb5bc5f6b99c9351e.zip | |
(regexp-opt): Always return a properly-grouped regexp.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/regexp-opt.el | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9b18c3e3b07..9f20d191528 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-05-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/regexp-opt.el (regexp-opt): Always return | ||
| 4 | a properly-grouped regexp. | ||
| 5 | |||
| 1 | 2008-05-23 Juanma Barranquero <lekktu@gmail.com> | 6 | 2008-05-23 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * progmodes/cap-words.el (capitalized-words-mode): | 8 | * progmodes/cap-words.el (capitalized-words-mode): |
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index 70f7141210d..309c8e7bb89 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el | |||
| @@ -107,7 +107,7 @@ by \\=\\< and \\>." | |||
| 107 | (open (cond ((stringp paren) paren) (paren "\\("))) | 107 | (open (cond ((stringp paren) paren) (paren "\\("))) |
| 108 | (sorted-strings (delete-dups | 108 | (sorted-strings (delete-dups |
| 109 | (sort (copy-sequence strings) 'string-lessp))) | 109 | (sort (copy-sequence strings) 'string-lessp))) |
| 110 | (re (regexp-opt-group sorted-strings open))) | 110 | (re (regexp-opt-group sorted-strings (or open t) (not open)))) |
| 111 | (if words (concat "\\<" re "\\>") re)))) | 111 | (if words (concat "\\<" re "\\>") re)))) |
| 112 | 112 | ||
| 113 | ;;;###autoload | 113 | ;;;###autoload |