From: Stefan Monnier Date: Wed, 24 Jul 2013 05:13:24 +0000 (-0400) Subject: * lisp/emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1710^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=249eea30ee8201fe9b872cf2c110aa546479b0e4;p=emacs.git * lisp/emacs-lisp/pcase.el (pcase--u1): Verify if self-quoting values can be checked with memq. Fixes: debbugs:14935 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24fbe1acb2c..6679bf8a9e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-07-24 Stefan Monnier + * 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. 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.