* lisp/emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 24 Jul 2013 05:13:24 +0000 (01:13 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 24 Jul 2013 05:13:24 +0000 (01:13 -0400)
checked with memq.

Fixes: debbugs:14935

lisp/ChangeLog
lisp/emacs-lisp/pcase.el

index 24fbe1a..6679bf8 100644 (file)
@@ -1,5 +1,8 @@
 2013-07-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be
+       checked with memq (bug#14935).
+
        * files.el (revert-buffer-function): Use a non-nil default.
        (revert-buffer-preserve-modes): Declare var to
        provide access to the `preserve-modes' argument.
index 511f148..50c9251 100644 (file)
@@ -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.