[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14935: 24.3.50; pcase (or) UPAT fails?
From: |
Stefan Monnier |
Subject: |
bug#14935: 24.3.50; pcase (or) UPAT fails? |
Date: |
Wed, 24 Jul 2013 01:14:10 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> (pcase "^"
> ((or "^" "%") (message "here")))
Yes, this should work, but it incorrectly used `memq' whereas the (or
`"^" `"%") pattern correctly leads to the use of `member'.
I installed the patch below which should fix it,
Stefan
=== modified file 'lisp/emacs-lisp/pcase.el'
--- lisp/emacs-lisp/pcase.el 2013-07-08 21:54:54 +0000
+++ lisp/emacs-lisp/pcase.el 2013-07-24 05:10:31 +0000
@@ -659,7 +659,11 @@
(memq-fine t))
(when all
(dolist (alt (cdr upat))
- (unless (or (pcase--self-quoting-p 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)