diff options
| -rw-r--r-- | lisp/emacs-lisp/pcase.el | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 4b7689ad42c..a8ce23284c4 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el | |||
| @@ -698,10 +698,15 @@ MATCH is the pattern that needs to be matched, of the form: | |||
| 698 | (dolist (binding (pcase--fgrep bindings (pop sexp))) | 698 | (dolist (binding (pcase--fgrep bindings (pop sexp))) |
| 699 | (push binding res) | 699 | (push binding res) |
| 700 | (setq bindings (remove binding bindings)))) | 700 | (setq bindings (remove binding bindings)))) |
| 701 | (let ((tmp (assq sexp bindings))) | 701 | (if (vectorp sexp) |
| 702 | (if tmp | 702 | ;; With backquote, code can appear within vectors as well. |
| 703 | (cons tmp res) | 703 | ;; This wouldn't be needed if we `macroexpand-all' before |
| 704 | res)))) | 704 | ;; calling pcase--fgrep, OTOH. |
| 705 | (pcase--fgrep bindings (mapcar #'identity sexp)) | ||
| 706 | (let ((tmp (assq sexp bindings))) | ||
| 707 | (if tmp | ||
| 708 | (cons tmp res) | ||
| 709 | res))))) | ||
| 705 | 710 | ||
| 706 | (defun pcase--self-quoting-p (upat) | 711 | (defun pcase--self-quoting-p (upat) |
| 707 | (or (keywordp upat) (integerp upat) (stringp upat))) | 712 | (or (keywordp upat) (integerp upat) (stringp upat))) |