summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/pcase.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-07-24 01:13:24 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-07-24 01:13:24 -0400
commit249eea30ee8201fe9b872cf2c110aa546479b0e4 (patch)
tree96fc94c08105e7458fe2b96f6812d7b0646e3339 /lisp/emacs-lisp/pcase.el
parentac93e56b698c82d9fcfbf39394740ec1f8d411c5 (diff)
downloademacs-249eea30ee8201fe9b872cf2c110aa546479b0e4.tar.gz
emacs-249eea30ee8201fe9b872cf2c110aa546479b0e4.tar.bz2
emacs-249eea30ee8201fe9b872cf2c110aa546479b0e4.zip
* lisp/emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be
checked with memq. Fixes: debbugs:14935
Diffstat (limited to 'lisp/emacs-lisp/pcase.el')
-rw-r--r--lisp/emacs-lisp/pcase.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 511f1480099..50c92518b02 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -659,11 +659,15 @@ Otherwise, it defers to REST which is a list of branches of the form
(memq-fine t))
(when all
(dolist (alt (cdr upat))
- (unless (or (pcase--self-quoting-p alt)
- (and (eq (car-safe alt) '\`)
- (or (symbolp (cadr alt)) (integerp (cadr alt))
- (setq memq-fine nil)
- (stringp (cadr alt)))))
+ (unless (if (pcase--self-quoting-p alt)
+ (progn
+ (unless (or (symbolp alt) (integerp alt))
+ (setq memq-fine nil))
+ t)
+ (and (eq (car-safe alt) '\`)
+ (or (symbolp (cadr alt)) (integerp (cadr alt))
+ (setq memq-fine nil)
+ (stringp (cadr alt)))))
(setq all nil))))
(if all
;; Use memq for (or `a `b `c `d) rather than a big tree.