+2008-12-09 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * emacs-lisp/rx.el (rx-submatch): Pass : to rx-form.
+
2008-12-09 Glenn Morris <rgm@gnu.org>
* Makefile.in (ELCFILES): Update.
(defun rx-submatch (form)
"Parse and produce code from FORM, which is `(submatch ...)'."
- (concat "\\(" (mapconcat #'rx-form (cdr form) nil) "\\)"))
+ (concat "\\("
+ (if (= 2 (length form))
+ ;; Only one sub-form.
+ (rx-form (cadr form))
+ ;; Several sub-forms implicitly concatenated.
+ (mapconcat (lambda (re) (rx-form re ':)) (cdr form) nil))
+ "\\)"))
(defun rx-backref (form)