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#50136: 28.0.50; A problem with rx-let expansion Date: Mon, 23 Aug 2021 17:20:42 +0200 Message-ID: <9CAC5CC8-CFC7-4B9A-952D-6E5BD43D0D80@acm.org> References: <878s0wcj3j.fsf@web.de> <87y28whw1b.fsf@web.de> <878s0vc97a.fsf@web.de> <3541B092-BD63-4610-BDA8-A43ABD4FAF6D@acm.org> <87a6l84ey2.fsf@web.de> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_E0076354-B2FE-48A7-B03C-9A9F5439C98F" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32016"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50136@debbugs.gnu.org, monnier@iro.umontreal.ca To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 23 17:21:32 2021 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 1mIBlT-00083k-U0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Aug 2021 17:21:32 +0200 Original-Received: from localhost ([::1]:51088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIBlS-0004sA-SP for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Aug 2021 11:21:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIBl0-0003m8-ML for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIBl0-0002UG-F8 for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIBl0-0002vB-9y for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Aug 2021 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50136 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.162973206111201 (code B ref -1); Mon, 23 Aug 2021 15:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Aug 2021 15:21:01 +0000 Original-Received: from localhost ([127.0.0.1]:42401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBky-0002ua-QT for submit@debbugs.gnu.org; Mon, 23 Aug 2021 11:21:01 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:53096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBkx-0002uT-6d for submit@debbugs.gnu.org; Mon, 23 Aug 2021 11:21:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIBkt-0003ko-PZ for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:20:57 -0400 Original-Received: from mail1475c50.megamailservers.eu ([91.136.14.75]:48142 helo=mail118c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIBkn-0002IG-Qx for bug-gnu-emacs@gnu.org; Mon, 23 Aug 2021 11:20:55 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1629732045; bh=K9ZfeUVzhUAPu9IvZjZAoiu3F7RvuW820rDMjX2Is0E=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=Y7scl0oXzmkONaxPRpAAWhZcgNMysp1mydy5y5xeiuqdN8NtvPpnZGLYw7tvxufW3 nowAuTrvMqKhLHzc9uU1Yf6Q8FDGsmObO54++LwkP/hVS9syNj1fc8FKor4cwHp25a J5BvcIKYUKehFrqqGytDxiiSh85Cae/Eh0/ItKng= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail118c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 17NFKhdB000798; Mon, 23 Aug 2021 15:20:44 +0000 In-Reply-To: <87a6l84ey2.fsf@web.de> X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F15.6123BCCD.0094, 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-CSC: 0 X-CHA: v=2.3 cv=Ro+70xuK c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=DG9AbkNqdOfO4dmz2loA:9 a=CjuIK1q_8ugA:10 a=JMAdihMaANsKMJ-yYn8A:9 a=B2y7HmGcmWMA:10 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.75; envelope-from=mattiase@acm.org; helo=mail118c50.megamailservers.eu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:212495 Archived-At: --Apple-Mail=_E0076354-B2FE-48A7-B03C-9A9F5439C98F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 23 aug. 2021 kl. 12.45 skrev Michael Heerdegen = : > I you find a way to get along without examples, all the better. I > suggested to use an example because it might be the simplest way to > explain how things work, and because the way things work may come > unexpected for some (like me). But providing some more details more > explicitly might be as good as well. Here is my proposed change to the manual. I didn't change the doc = strings since they already refer to that Info node. Good enough? --Apple-Mail=_E0076354-B2FE-48A7-B03C-9A9F5439C98F Content-Disposition: attachment; filename=0001-Add-example-of-advanced-user-defined-Rx-form-to-manu.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Add-example-of-advanced-user-defined-Rx-form-to-manu.patch" Content-Transfer-Encoding: quoted-printable =46rom=20cb1daffa5f226278723b4a96a698883d7010947a=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Mon,=2023=20Aug=202021=2017:02:51=20+0200=0A= Subject:=20[PATCH]=20Add=20example=20of=20advanced=20user-defined=20Rx=20= form=20to=20manual=0A=0A*=20doc/lispref/searching.texi=20(Extending=20= Rx):=20Add=20example=20illustrating=0Ahow=20to=20define=20a=20= user-defined=20Rx=20form=20that=20performs=20computation,=0Afrom=20a=20= discussion=20with=20Michael=20Herdeegen=20(bug#50136).=0A---=0A=20= doc/lispref/searching.texi=20|=2019=20+++++++++++++++++++=0A=201=20file=20= changed,=2019=20insertions(+)=0A=0Adiff=20--git=20= a/doc/lispref/searching.texi=20b/doc/lispref/searching.texi=0Aindex=20= 4d5ae3cb43..a0935eee2b=20100644=0A---=20a/doc/lispref/searching.texi=0A= +++=20b/doc/lispref/searching.texi=0A@@=20-1649,6=20+1649,25=20@@=20= Extending=20Rx=0A=20Since=20the=20definition=20is=20global,=20it=20is=20= recommended=20to=20give=20@var{name}=20a=0A=20package=20prefix=20to=20= avoid=20name=20clashes=20with=20definitions=20elsewhere,=20as=20is=0A=20= usual=20when=20naming=20non-local=20variables=20and=20functions.=0A+=0A= +User-defined=20forms=20themselves=20only=20perform=20simple=20template=0A= +substitution.=20=20For=20arbitrary=20computations,=20use=20them=20= together=20with=20with=0A+the=20@code{rx}=20forms=20@code{eval},=20= @code{regexp}=20or=20@code{literal}.=0A+Example:=0A+=0A+@example=0A= +@group=0A+(defun=20n-tuple-rx=20(n=20element)=0A+=20=20`(seq=20"<"=0A+=20= =20=20=20=20=20=20=20(group-n=201=20,element)=0A+=20=20=20=20=20=20=20=20= ,@@(mapcar=20(lambda=20(i)=20`(seq=20?,=20(group-n=20,i=20,element)))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(number-sequence=20= 2=20n))=0A+=20=20=20=20=20=20=20=20">"))=0A+(rx-define=20n-tuple=20(n=20= element)=20(eval=20(n-tuple-rx=20n=20'element)))=0A+(rx=20(n-tuple=203=20= (+=20(in=20"0-9"))))=0A+=20=20@result{}=20= "<\\(?1:[0-9]+\\),\\(?2:[0-9]+\\),\\(?3:[0-9]+\\)>"=0A+@end=20group=0A= +@end=20example=0A=20@end=20defmac=0A=20=0A=20@defmac=20rx-let=20= (bindings@dots{})=20body@dots{}=0A--=20=0A2.21.1=20(Apple=20Git-122.3)=0A= =0A= --Apple-Mail=_E0076354-B2FE-48A7-B03C-9A9F5439C98F--