summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-11-09 17:11:05 +0100
committerEli Zaretskii <eliz@gnu.org>2020-11-09 18:59:24 +0200
commit78e1646bf7bde8f00c196319f4803e98460d506a (patch)
treedf9ff3a595c356760fb22029ebf718f607ac4c72 /lisp/emacs-lisp
parent75384bd1555feca0ba11948ed71e4b557b8da59f (diff)
downloademacs-78e1646bf7bde8f00c196319f4803e98460d506a.tar.gz
emacs-78e1646bf7bde8f00c196319f4803e98460d506a.tar.bz2
emacs-78e1646bf7bde8f00c196319f4803e98460d506a.zip
Fix pcase rx form snag with '?' and '??' (bug#44532)
This is a regression from Emacs 26. Reported by Phillip Stephani. * lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case. (cherry picked from commit 575b0681d926463960fc00d1e33decaa71d5c956)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/rx.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 6564563e7ec..88c843f3ce6 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1413,7 +1413,7 @@ into a plain rx-expression, collecting names into `rx--pcase-vars'."
(mapconcat #'symbol-name rx--pcase-vars " ")))
`(backref ,index)))
((and `(,head . ,rest)
- (guard (and (symbolp head)
+ (guard (and (or (symbolp head) (memq head '(?\s ??)))
(not (memq head '(literal regexp regex eval))))))
(cons head (mapcar #'rx--pcase-transform rest)))
(_ rx)))