summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/rx.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 1b5afe73b45..24dd6cbf1d6 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -874,7 +874,7 @@ If FORM is `(minimal-match FORM1)', non-greedy versions of `*',
(defun rx-regexp (form)
"Parse and produce code from FORM, which is `(regexp STRING)'."
- (cond ((stringp form)
+ (cond ((stringp (cadr form))
(rx-group-if (cadr form) rx-parent))
(rx--compile-to-lisp
;; Always group non-string forms, since we can't be sure they
@@ -884,7 +884,7 @@ If FORM is `(minimal-match FORM1)', non-greedy versions of `*',
(defun rx-literal (form)
"Parse and produce code from FORM, which is `(literal STRING-EXP)'."
- (cond ((stringp form)
+ (cond ((stringp (cadr form))
;; This is allowed, but makes little sense, you could just
;; use STRING directly.
(rx-group-if (regexp-quote (cadr form)) rx-parent))