summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/rx.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/rx.el')
-rw-r--r--lisp/emacs-lisp/rx.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 43bd84d9990..071d390f0e4 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1442,10 +1442,9 @@ following constructs:
introduced by a previous (let REF ...)
construct."
(let* ((rx--pcase-vars nil)
- (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps))))
- (nvars (length rx--pcase-vars)))
+ (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps)))))
`(and (pred stringp)
- ,(pcase nvars
+ ,(pcase (length rx--pcase-vars)
(0
;; No variables bound: a single predicate suffices.
`(pred (string-match ,regexp)))
@@ -1458,7 +1457,7 @@ following constructs:
(match-string 1 s)
0))
(and ,(car rx--pcase-vars) (pred (not numberp)))))
- (_
+ (nvars
;; Pack the submatches into a dotted list which is then
;; immediately destructured into individual variables again.
;; This is of course slightly inefficient.