From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: [PATCH] lexical-binding in rx.el Date: Thu, 14 Feb 2019 13:31:25 +0100 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_D1058596-A076-4A70-BDA4-C81664EC27F0" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="140515"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 14 13:45:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1guGOL-000aS8-Oe for ged-emacs-devel@m.gmane.org; Thu, 14 Feb 2019 13:45:26 +0100 Original-Received: from localhost ([127.0.0.1]:47691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guGOJ-0000u0-U0 for ged-emacs-devel@m.gmane.org; Thu, 14 Feb 2019 07:45:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guGL3-00073s-QD for emacs-devel@gnu.org; Thu, 14 Feb 2019 07:42:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guGAx-00044s-Jg for emacs-devel@gnu.org; Thu, 14 Feb 2019 07:31:36 -0500 Original-Received: from mail78c50.megamailservers.eu ([91.136.10.88]:37390 helo=mail70c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guGAv-0003xG-Mw for emacs-devel@gnu.org; Thu, 14 Feb 2019 07:31:34 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1550147487; bh=6DG0p0u5xlH4ZXEwMOfWatM85GFgtJNUOrJhh76iKBE=; h=From:Subject:Date:To:From; b=RD/zUX/KWz6SwmkE+0/YDFbl1/RIZKTZkKJLXqyie/En2XE+3zgKji88wXGiw1S05 f0+B51nzWwV2GFZVcv2fVTktNduXlK+CZvQLfNPjbc1xB5a1/hl+mQEyhl4Cqt4NP0 D3JH+S/Xm9HLHG16/bywT/WjRxpRdGwjqlQ9GN14= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c83-251-8-17.bredband.comhem.se [83.251.8.17]) (authenticated bits=0) by mail70c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x1ECVPwp020424 for ; Thu, 14 Feb 2019 12:31:27 +0000 X-Mailer: Apple Mail (2.3445.102.3) X-CTCH-RefID: str=0001.0A0B0204.5C655F9F.0043, 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=PNMhB8iC c=1 sm=1 tr=0 a=NAHmi3I8mP0S/Y8gRKeQyA==:117 a=NAHmi3I8mP0S/Y8gRKeQyA==:17 a=F0UQRrd8baC2Az_YncIA:9 a=CjuIK1q_8ugA:10 a=KuJv_xo9DNYifs-MBxoA:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.88 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233311 Archived-At: --Apple-Mail=_D1058596-A076-4A70-BDA4-C81664EC27F0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii One more file using lexical binding. --Apple-Mail=_D1058596-A076-4A70-BDA4-C81664EC27F0 Content-Disposition: attachment; filename=0001-Use-lexical-binding-in-rx.el.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Use-lexical-binding-in-rx.el.patch" Content-Transfer-Encoding: quoted-printable =46rom=20e8cdef252be10bfb7357758a502b829571c2b9ae=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=2014=20Feb=202019=2013:20:08=20+0100=0A= Subject:=20[PATCH]=20Use=20lexical-binding=20in=20rx.el=0A=0A*=20= lisp/emacs-lisp/rx.el:=20Use=20lexical-binding.=0A(rx-form):=20Use=20= `let'=20to=20bind=20the=20dynamic=20variable=20`rx-parent'=20instead=0A= of=20binding=20it=20as=20an=20argument.=0A---=0A=20lisp/emacs-lisp/rx.el=20= |=2051=20++++++++++++++++++++++---------------------=0A=201=20file=20= changed,=2026=20insertions(+),=2025=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/emacs-lisp/rx.el=20b/lisp/emacs-lisp/rx.el=0Aindex=20= d00b86819c..c0a5d52788=20100644=0A---=20a/lisp/emacs-lisp/rx.el=0A+++=20= b/lisp/emacs-lisp/rx.el=0A@@=20-1,4=20+1,4=20@@=0A-;;;=20rx.el=20---=20= sexp=20notation=20for=20regular=20expressions=0A+;;;=20rx.el=20---=20= sexp=20notation=20for=20regular=20expressions=20=20-*-=20= lexical-binding:=20t=20-*-=0A=20=0A=20;;=20Copyright=20(C)=202001-2019=20= Free=20Software=20Foundation,=20Inc.=0A=20=0A@@=20-841,33=20+841,34=20@@=20= If=20FORM=20is=20`(minimal-match=20FORM1)',=20non-greedy=20versions=20of=20= `*',=0A=20=20=20(rx-group-if=20(cadr=20form)=20rx-parent))=0A=20=0A=20=0A= -(defun=20rx-form=20(form=20&optional=20rx-parent)=0A+(defun=20rx-form=20= (form=20&optional=20parent)=0A=20=20=20"Parse=20and=20produce=20code=20= for=20regular=20expression=20FORM.=0A=20FORM=20is=20a=20regular=20= expression=20in=20sexp=20form.=0A-RX-PARENT=20shows=20which=20type=20of=20= expression=20calls=20and=20controls=20putting=20of=0A+PARENT=20shows=20= which=20type=20of=20expression=20calls=20and=20controls=20putting=20of=0A= =20shy=20groups=20around=20the=20result=20and=20some=20more=20in=20other=20= functions."=0A-=20=20(cond=0A-=20=20=20((stringp=20form)=0A-=20=20=20=20= (rx-group-if=20(regexp-quote=20form)=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(if=20(and=20(eq=20rx-parent=20'*)=20(<=201=20(length=20= form)))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= rx-parent)))=0A-=20=20=20((integerp=20form)=0A-=20=20=20=20(regexp-quote=20= (char-to-string=20form)))=0A-=20=20=20((symbolp=20form)=0A-=20=20=20=20= (let=20((info=20(rx-info=20form=20nil)))=0A-=20=20=20=20=20=20(cond=20= ((stringp=20info)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20info)=0A-=20=20= =20=20=20=20=20=20=20=20=20=20((null=20info)=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20(error=20"Unknown=20rx=20form=20`%s'"=20form))=0A-=20=20=20=20= =20=20=20=20=20=20=20=20(t=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= (funcall=20(nth=200=20info)=20form)))))=0A-=20=20=20((consp=20form)=0A-=20= =20=20=20(let=20((info=20(rx-info=20(car=20form)=20'head)))=0A-=20=20=20=20= =20=20(unless=20(consp=20info)=0A-=20=20=20=20=20=20=20=20(error=20= "Unknown=20rx=20form=20`%s'"=20(car=20form)))=0A-=20=20=20=20=20=20= (funcall=20(nth=200=20info)=20form)))=0A-=20=20=20(t=0A-=20=20=20=20= (error=20"rx=20syntax=20error=20at=20`%s'"=20form))))=0A+=20=20(let=20= ((rx-parent=20parent))=0A+=20=20=20=20(cond=0A+=20=20=20=20=20((stringp=20= form)=0A+=20=20=20=20=20=20(rx-group-if=20(regexp-quote=20form)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20(and=20(eq=20= parent=20'*)=20(<=201=20(length=20form)))=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20parent)))=0A+=20=20=20=20=20= ((integerp=20form)=0A+=20=20=20=20=20=20(regexp-quote=20(char-to-string=20= form)))=0A+=20=20=20=20=20((symbolp=20form)=0A+=20=20=20=20=20=20(let=20= ((info=20(rx-info=20form=20nil)))=0A+=20=20=20=20=20=20=20=20(cond=20= ((stringp=20info)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20info)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20((null=20info)=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(error=20"Unknown=20rx=20form=20`%s'"=20= form))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20(t=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(funcall=20(nth=200=20info)=20form)))))=0A= +=20=20=20=20=20((consp=20form)=0A+=20=20=20=20=20=20(let=20((info=20= (rx-info=20(car=20form)=20'head)))=0A+=20=20=20=20=20=20=20=20(unless=20= (consp=20info)=0A+=20=20=20=20=20=20=20=20=20=20(error=20"Unknown=20rx=20= form=20`%s'"=20(car=20form)))=0A+=20=20=20=20=20=20=20=20(funcall=20(nth=20= 0=20info)=20form)))=0A+=20=20=20=20=20(t=0A+=20=20=20=20=20=20(error=20= "rx=20syntax=20error=20at=20`%s'"=20form)))))=0A=20=0A=20=0A=20= ;;;###autoload=0A--=20=0A2.17.2=20(Apple=20Git-113)=0A=0A= --Apple-Mail=_D1058596-A076-4A70-BDA4-C81664EC27F0--