From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#37517: New rx.el breaks a number of packages - missing symbol rx-submatch-n Date: Thu, 26 Sep 2019 12:01:46 +0200 Message-ID: <24516DC3-8F75-4544-800F-FFBBAC977B35@acm.org> References: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_073EC873-58E4-4E45-94A5-9B3EB0D5D6E4" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="234490"; mail-complaints-to="usenet@blaine.gmane.org" Cc: =?UTF-8?Q?Cl=C3=A9ment?= Pit-Claudel , Tim Cross , fmdkdd To: 37517@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 26 12:05:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDQe3-000ynN-O9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Sep 2019 12:05:08 +0200 Original-Received: from localhost ([::1]:33204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDQe2-0008Rs-Ev for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Sep 2019 06:05:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33590) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDQb7-0005Ma-PN for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 06:02:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDQb6-0005oe-94 for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 06:02:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33902) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDQb5-0005oE-5F for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 06:02:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iDQb4-0007Dw-Ba for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2019 06:02:03 -0400 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: Thu, 26 Sep 2019 10:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37517 X-GNU-PR-Package: emacs Original-Received: via spool by 37517-submit@debbugs.gnu.org id=B37517.156949211927759 (code B ref 37517); Thu, 26 Sep 2019 10:02:02 +0000 Original-Received: (at 37517) by debbugs.gnu.org; 26 Sep 2019 10:01:59 +0000 Original-Received: from localhost ([127.0.0.1]:42723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDQb1-0007Df-5E for submit@debbugs.gnu.org; Thu, 26 Sep 2019 06:01:59 -0400 Original-Received: from mail85c50.megamailservers.eu ([91.136.10.95]:34514 helo=mail18c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iDQaw-0007DP-Jq for 37517@debbugs.gnu.org; Thu, 26 Sep 2019 06:01:57 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1569492109; bh=Ja8xru7pnCHco6iXvlOMBqf/bvnRFshQLqwYtuGaCYk=; h=From:Subject:Date:Cc:To:From; b=JvsEClFs4k/GjtboVZTBHJnnhqPgs5/8NEl3FsRhKrq/iiZkNGRXFJwRX4ny2sbvY OD1FRNDH55km3LpV3mENAyYu6/SWxfqbRF69hswDYGhZwEzcqA3gr4u77VLHaFyVdN 8W+4W1zoNZqPqDPfnTckAMS9i36agNHBNEgVAEvM= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] ([188.150.171.71]) (authenticated bits=0) by mail18c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x8QA1lmJ001276; Thu, 26 Sep 2019 10:01:49 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0209.5D8C8C8D.0067, 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=dPfYZ9Rb c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=PgBeS6AMstXKlFkAAD4A:9 a=QEXdDO2ut3YA:10 a=lnHa-nA8KI-lh-PtUpcA:9 a=B2y7HmGcmWMA:10 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:167219 Archived-At: --Apple-Mail=_073EC873-58E4-4E45-94A5-9B3EB0D5D6E4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 [CC:ed the flycheck maintainers; hope you don't mind] Tim Cross skrev: >The latest version of rx.el added in commit 2ed71227c626c6cfdc684 seems >to have broken a number of packages with the error >Symbol=E2=80=99s function definition is void: rx-submatch-n >Packages affected include flycheck-color-mode-line, flycheck-joker and >tide from MELPA. Thanks for the report. The old rx code was apparently written prior to = the double-hyphen convention for marking package-internal symbols, and = `rx-submatch-n' is clearly an internal function; I'm not sure why it is = used by flycheck. Of course we could attempt to implement `rx-submatch-n' and what other = internal stuff happen to be used by external packages, but that's an = open-ended endeavour. Furthermore, it may not always be possible to = replicate the expected semantics (internal variables are particularly = difficult in that respect). I'd much rather work with package maintainers to promote the use of = stable interfaces. What about the attached patch (untested)? --Apple-Mail=_073EC873-58E4-4E45-94A5-9B3EB0D5D6E4 Content-Disposition: attachment; filename=0001-Don-t-use-internal-rx-functions.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Don-t-use-internal-rx-functions.patch" Content-Transfer-Encoding: quoted-printable =46rom=20be57a682edb63b071b10b989db0f2e4c0ccca800=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=2026=20Sep=202019=2011:56:39=20+0200=0A= Subject:=20[PATCH]=20Don't=20use=20internal=20rx=20functions=0A=0AUse=20= rx-to-string=20instead=20of=20the=20internal=20rx-submatch-n,=20which=20= is=20gone=0Ain=20Emacs=2027=20and=20never=20was=20intended=20for=20= public=20use.=0A---=0A=20flycheck.el=20|=206=20+++---=0A=201=20file=20= changed,=203=20insertions(+),=203=20deletions(-)=0A=0Adiff=20--git=20= a/flycheck.el=20b/flycheck.el=0Aindex=2099cf70a6..62090df2=20100644=0A= ---=20a/flycheck.el=0A+++=20b/flycheck.el=0A@@=20-1400,16=20+1400,16=20= @@=20Safely=20delete=20all=20files=20and=20directories=20listed=20in=0A=20= =20=20"Translate=20the=20`(file-name)'=20FORM=20into=20a=20regular=20= expression."=0A=20=20=20(let=20((body=20(or=20(cdr=20form)=20= '((minimal-match=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(one-or-more=20= not-newline))))))=0A-=20=20=20=20(rx-submatch-n=20`(group-n=201=20= ,@body))))=0A+=20=20=20=20(rx-to-string=20`(group-n=201=20,@body)=20t)))=0A= =20=0A=20(defun=20flycheck-rx-message=20(form)=0A=20=20=20"Translate=20= the=20`(message)'=20FORM=20into=20a=20regular=20expression."=0A=20=20=20= (let=20((body=20(or=20(cdr=20form)=20'((one-or-more=20not-newline)))))=0A= -=20=20=20=20(rx-submatch-n=20`(group-n=204=20,@body))))=0A+=20=20=20=20= (rx-to-string=20`(group-n=204=20,@body)=20t)))=0A=20=0A=20(defun=20= flycheck-rx-id=20(form)=0A=20=20=20"Translate=20the=20`(id)'=20FORM=20= into=20a=20regular=20expression."=0A-=20=20(rx-submatch-n=20`(group-n=20= 5=20,@(cdr=20form))))=0A+=20=20(rx-to-string=20`(group-n=205=20=20,@(cdr=20= form))=20t))=0A=20=0A=20(defun=20flycheck-rx-to-string=20(form=20= &optional=20no-group)=0A=20=20=20"Like=20`rx-to-string'=20for=20FORM,=20= but=20with=20special=20keywords:=0A--=20=0A2.21.0=20(Apple=20Git-122)=0A=0A= --Apple-Mail=_073EC873-58E4-4E45-94A5-9B3EB0D5D6E4--