From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.bugs Subject: bug#14935: 24.3.50; pcase (or) UPAT fails? Date: Wed, 24 Jul 2013 09:19:19 +0200 Organization: EUR Message-ID: <87a9lcfmrs.fsf@gmail.com> References: <87ip01fr90.fsf@gmail.com> <87ehapf0v3.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374650421 29126 80.91.229.3 (24 Jul 2013 07:20:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jul 2013 07:20:21 +0000 (UTC) Cc: 14935-done@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 24 09:20:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V1tMv-0006au-Mx for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jul 2013 09:20:17 +0200 Original-Received: from localhost ([::1]:47570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tMv-0007qw-76 for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jul 2013 03:20:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tMl-0007qN-Uj for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2013 03:20:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1tMi-0002Dg-AW for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2013 03:20:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1tMi-0002BR-7O for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2013 03:20:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V1tMg-0002Xd-RI for bug-gnu-emacs@gnu.org; Wed, 24 Jul 2013 03:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vitalie Spinu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jul 2013 07:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14935 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14935-done@debbugs.gnu.org id=D14935.13746503719540 (code D ref 14935); Wed, 24 Jul 2013 07:20:02 +0000 Original-Received: (at 14935-done) by debbugs.gnu.org; 24 Jul 2013 07:19:31 +0000 Original-Received: from localhost ([127.0.0.1]:46199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V1tM9-0002Tm-Vd for submit@debbugs.gnu.org; Wed, 24 Jul 2013 03:19:30 -0400 Original-Received: from mail-ea0-f177.google.com ([209.85.215.177]:52984) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V1tM7-0002Sw-E3 for 14935-done@debbugs.gnu.org; Wed, 24 Jul 2013 03:19:28 -0400 Original-Received: by mail-ea0-f177.google.com with SMTP id f15so33633eak.22 for <14935-done@debbugs.gnu.org>; Wed, 24 Jul 2013 00:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=T1UB2a74oP+TszW8J3am4b5W4/ybtknWmj78O4n/dfU=; b=i6xoSi6jSnRGsooGe+Dn8RBP4WYu95oKYIexSFSt4A/2Yv1SQgGn0TseSg6ARwKMkW CnEta1Er88+6MLZQVpxKnbsiCS5K28OuL5pDFbXbrC7wyQdxdv0NXiUNgRiM8vLLPGoq e00EBhiPQ24cpD3cMgkqTI49+5LYzIdMZG4FaPVlnZwAg9lNxM1zmImaXYv96KE1phjD hdOtOymWZqLKSkyAl1MFBoYrthqoU90oCaLMcWE2DAHhkfZfLtHXaLwKVjascc+i11ME xM08iMIUm35ESjSdBKz5wtrMxiwNJ48cEaYyke06Dg3aUgpCa1XA3KddVxJd4ravEEgl asqA== X-Received: by 10.14.4.70 with SMTP id 46mr35553927eei.42.1374650361360; Wed, 24 Jul 2013 00:19:21 -0700 (PDT) Original-Received: from localhost (dhcp-077-249-018-128.chello.nl. [77.249.18.128]) by mx.google.com with ESMTPSA id w43sm63907950eez.6.2013.07.24.00.19.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 24 Jul 2013 00:19:20 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 24 Jul 2013 01:14:10 -0400") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76617 Archived-At: Thanks, it works. And more complex patterns are also fine now: (pcase (list 23 nil "%") (`(,x nil ,(or "^" "%")) (message "%s" x))) >> Stefan Monnier >> on Wed, 24 Jul 2013 01:14:10 -0400 wrote: >> (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)