Mercurial > emacs
comparison lisp/emacs-lisp/rx.el @ 52971:d5c1eeaa97e2
(rx-or): Fix the case of "(rx (and ?a (or ?b ?c) ?d))".
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 01 Nov 2003 17:35:23 +0000 |
parents | 695cf19ef79e |
children | 818e19ae4c5a |
comparison
equal
deleted
inserted
replaced
52970:33edcfca670d | 52971:d5c1eeaa97e2 |
---|---|
284 (rx-check form) | 284 (rx-check form) |
285 (let ((all-args-strings t)) | 285 (let ((all-args-strings t)) |
286 (dolist (arg (cdr form)) | 286 (dolist (arg (cdr form)) |
287 (unless (stringp arg) | 287 (unless (stringp arg) |
288 (setq all-args-strings nil))) | 288 (setq all-args-strings nil))) |
289 (if all-args-strings | 289 (concat "\\(?:" |
290 (regexp-opt (cdr form)) | 290 (if all-args-strings |
291 (mapconcat #'rx-to-string (cdr form) "\\|")))) | 291 (regexp-opt (cdr form)) |
292 (mapconcat #'rx-to-string (cdr form) "\\|")) | |
293 "\\)"))) | |
292 | 294 |
293 | 295 |
294 (defun rx-quote-for-set (string) | 296 (defun rx-quote-for-set (string) |
295 "Transform STRING for use in a character set. | 297 "Transform STRING for use in a character set. |
296 If STRING contains a `]', move it to the front. | 298 If STRING contains a `]', move it to the front. |