From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#59814: 28.2; `rx-let` bindings are not visible to `pcase` `rx` forms Date: Sun, 4 Dec 2022 15:37:06 +0100 Message-ID: <6CD6FD14-87A2-4221-87E8-5BF879C99C2C@acm.org> References: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_537DF1BC-A72C-43F7-92CF-D764B437DC1D" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25170"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Pittman To: 59814@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 04 15:38:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p1q8L-0006KM-JT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Dec 2022 15:38:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1q84-0003FH-UF; Sun, 04 Dec 2022 09:38:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1q83-0003Eo-AY for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 09:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1q82-0004us-4J for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 09:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1q81-0000PJ-OF for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 09:38:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Dec 2022 14:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59814 X-GNU-PR-Package: emacs Original-Received: via spool by 59814-submit@debbugs.gnu.org id=B59814.16701646431554 (code B ref 59814); Sun, 04 Dec 2022 14:38:01 +0000 Original-Received: (at 59814) by debbugs.gnu.org; 4 Dec 2022 14:37:23 +0000 Original-Received: from localhost ([127.0.0.1]:58037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1q7P-0000P0-82 for submit@debbugs.gnu.org; Sun, 04 Dec 2022 09:37:23 -0500 Original-Received: from mail1451c50.megamailservers.eu ([91.136.14.51]:48852 helo=mail266c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1q7K-0000Or-JY for 59814@debbugs.gnu.org; Sun, 04 Dec 2022 09:37:21 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1670164630; bh=//qD7PEjzmOKo7WkuQ5Ny5+ub42fkkUl7nKOZQhc9fA=; h=From:Subject:Date:Cc:To:From; b=Qk4ILWl0YkHTJU5/ivOcUglNm62q82z1gwGis2SEeMSwH++OBJKAUlKmLhFTvm3B5 GGXTGwshCSoTnE5CZb0EmVo3oFP/X/7THxU4o5p+zTrg0MRlggq+WUmdlWb+w60Mpn 5Jr4Znx7hp2x2p8P1dPqZMloEuWw7o1Is5UcX+TE= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se [188.150.171.209]) (authenticated bits=0) by mail266c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 2B4Eb7Mq091897; Sun, 4 Dec 2022 14:37:10 +0000 X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A782F27.638CB096.0018, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249947 Archived-At: --Apple-Mail=_537DF1BC-A72C-43F7-92CF-D764B437DC1D Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii That's terrible. Would this patch help? --Apple-Mail=_537DF1BC-A72C-43F7-92CF-D764B437DC1D Content-Disposition: attachment; filename=0001-Fix-pcase-rx-patterns-using-rx-let-bindings-bug-5981.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Fix-pcase-rx-patterns-using-rx-let-bindings-bug-5981.patch" Content-Transfer-Encoding: quoted-printable =46rom=2030894f0ed19572b6b55dfb791a8fd8a84bfd660a=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=204=20Dec=202022=2015:20:49=20+0100=0A= Subject:=20[PATCH]=20Fix=20pcase=20rx=20patterns=20using=20rx-let=20= bindings=20(bug#59814)=0A=0AReported=20by=20Daniel=20Pittman.=0A=0A*=20= lisp/emacs-lisp/rx.el=20(rx):=20Move=20binding=20of=20= rx--local-definitions...=0A(rx--to-expr):=20...here.=0A*=20= test/lisp/emacs-lisp/rx-tests.el=20(rx-let-pcase):=20New=20test.=0A---=0A= =20lisp/emacs-lisp/rx.el=20=20=20=20=20=20=20=20=20=20=20=20|=2014=20= +++++++-------=0A=20test/lisp/emacs-lisp/rx-tests.el=20|=20=206=20++++++=0A= =202=20files=20changed,=2013=20insertions(+),=207=20deletions(-)=0A=0A= diff=20--git=20a/lisp/emacs-lisp/rx.el=20b/lisp/emacs-lisp/rx.el=0Aindex=20= ec51146484..f2a0dc5483=20100644=0A---=20a/lisp/emacs-lisp/rx.el=0A+++=20= b/lisp/emacs-lisp/rx.el=0A@@=20-1152,7=20+1152,12=20@@=20rx-to-string=0A=20= =0A=20(defun=20rx--to-expr=20(form)=0A=20=20=20"Translate=20the=20= rx-expression=20FORM=20to=20a=20Lisp=20expression=20yielding=20a=20= regexp."=0A-=20=20(let*=20((rx--delayed-evaluation=20t)=0A+=20=20(let*=20= ((rx--local-definitions=0A+=20=20=20=20=20=20=20=20=20=20;;=20Retrieve=20= local=20definitions=20from=20the=20macroexpansion=20environment.=0A+=20=20= =20=20=20=20=20=20=20=20;;=20(It's=20unclear=20whether=20the=20previous=20= value=20of=20`rx--local-definitions'=0A+=20=20=20=20=20=20=20=20=20=20;;=20= should=20be=20included,=20and=20if=20so,=20in=20which=20order.)=0A+=20=20= =20=20=20=20=20=20=20=20(cdr=20(assq=20:rx-locals=20= macroexpand-all-environment)))=0A+=20=20=20=20=20=20=20=20=20= (rx--delayed-evaluation=20t)=0A=20=20=20=20=20=20=20=20=20=20(elems=20= (car=20(rx--translate=20form)))=0A=20=20=20=20=20=20=20=20=20=20(args=20= nil))=0A=20=20=20=20=20;;=20Merge=20adjacent=20strings.=0A@@=20-1282,12=20= +1287,7=20@@=20rx=0A=20which=20see.=0A=20=0A=20\(fn=20REGEXPS...)"=0A-=20= =20;;=20Retrieve=20local=20definitions=20from=20the=20macroexpansion=20= environment.=0A-=20=20;;=20(It's=20unclear=20whether=20the=20previous=20= value=20of=20`rx--local-definitions'=0A-=20=20;;=20should=20be=20= included,=20and=20if=20so,=20in=20which=20order.)=0A-=20=20(let=20= ((rx--local-definitions=0A-=20=20=20=20=20=20=20=20=20(cdr=20(assq=20= :rx-locals=20macroexpand-all-environment))))=0A-=20=20=20=20(rx--to-expr=20= (cons=20'seq=20regexps))))=0A+=20=20(rx--to-expr=20(cons=20'seq=20= regexps)))=0A=20=0A=20(defun=20rx--make-binding=20(name=20tail)=0A=20=20=20= "Make=20a=20definitions=20entry=20out=20of=20TAIL.=0Adiff=20--git=20= a/test/lisp/emacs-lisp/rx-tests.el=20b/test/lisp/emacs-lisp/rx-tests.el=0A= index=20125ddee859..01772e54d8=20100644=0A---=20= a/test/lisp/emacs-lisp/rx-tests.el=0A+++=20= b/test/lisp/emacs-lisp/rx-tests.el=0A@@=20-207,6=20+207,12=20@@=20= rx-pcase=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (list=20'ok=20z))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= '(ok=20"F"))))=0A=20=0A+(ert-deftest=20rx-let-pcase=20()=0A+=20=20"Test=20= `rx-let'=20around=20`pcase'=20with=20`rx'=20patterns=20(bug#59814)."=0A+=20= =20(should=20(equal=20(rx-let=20((tata=20"ab"))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(pcase=20"abc"=20((rx=20tata)=20= 'toto)))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'toto)))=0A= +=0A=20(ert-deftest=20rx-kleene=20()=0A=20=20=20"Test=20greedy=20and=20= non-greedy=20repetition=20operators."=0A=20=20=20(should=20(equal=20(rx=20= (*=20"a")=20(+=20"b")=20(\?=20"c")=20(?\s=20"d")=0A--=20=0A2.32.0=20= (Apple=20Git-132)=0A=0A= --Apple-Mail=_537DF1BC-A72C-43F7-92CF-D764B437DC1D--