From unknown Sun Jun 22 07:39:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jun 2019 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36444 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 36444@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15618977595830 (code B ref -1); Sun, 30 Jun 2019 12:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jun 2019 12:29:19 +0000 Received: from localhost ([127.0.0.1]:45464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhYxL-0001Vy-Gn for submit@debbugs.gnu.org; Sun, 30 Jun 2019 08:29:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:37438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhYxJ-0001Vq-Cv for submit@debbugs.gnu.org; Sun, 30 Jun 2019 08:29:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36694) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhYxI-0005lx-Hr for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 08:29:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhYxH-00061M-Jd for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 08:29:16 -0400 Received: from mail205c50.megamailservers.eu ([91.136.10.215]:36430 helo=mail193c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hhYxH-0005mo-0V for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 08:29:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1561897740; bh=gm9T1VDSqK7MIsyvaU6Bbsf39+oM9y3CpwQGDOklcZY=; h=From:Subject:Date:To:From; b=qoKDwZBuBHgTUyGLDZxVpZ1xobAG60q+ysMAkdkebBemUUHwEFtUIgsVcmufdcETy 5/h/SIrnORmbFqGxHvxMrbuV95CNpcm2kr19YHNxwgg7yJpsT9v01NZqrQ/UlfjkWU Nus/vC8Sgyna/ubwQw7e4bLMvTyXn5QeZu6Z/R94= Feedback-ID: mattiase@acm.or Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x5UCSv1D009634 for ; Sun, 30 Jun 2019 12:29:00 +0000 From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Message-Id: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> Date: Sun, 30 Jun 2019 14:28:57 +0200 X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020F.5D18AB0C.0048, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KsZjJ1eN c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=lvMLtnk2CsVkxFO_dGUA:9 a=CjuIK1q_8ugA:10 a=s2lJpgmBrr0SaIv6U2UA: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.215 X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Currently, regexp-opt does not attempt optimisation with KEEP-ORDER set = if the input list contains a proper prefix of another element, like ("ab" "abcd") on the grounds that the optimised string would be "ab\\(?:cd\\)?" which would not preserve the match order. However, this also prevents ("abcd" "ab") from being optimised, even though doing so would be harmless. The attached patch strengthens the check, allowing more inputs to be = optimised. --Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357 Content-Disposition: attachment; filename=0001-Optimise-more-inputs-to-regexp-opt.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Optimise-more-inputs-to-regexp-opt.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ee29b82719c6ca40b3ff9054fcbf4e964ed18ad3=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=2030=20Jun=202019=2012:53:52=20+0200=0A= Subject:=20[PATCH]=20Optimise=20more=20inputs=20to=20`regexp-opt'=0A=0A= Use=20a=20more=20precise=20test=20to=20determine=20whether=20the=20input=20= to=20`regexp-opt'=0Ais=20safe=20to=20optimise=20when=20KEEP-ORDER=20is=20= non-nil,=20permitting=20more=20inputs=0Ato=20be=20optimised=20than=20= before.=20=20For=20example,=20("good"=20"goal"=20"go")=20is=20now=0A= accepted.=0A=0A*=20lisp/emacs-lisp/regexp-opt.el=20(regexp-opt):=0AMore=20= precise=20test=20for=20whether=20the=20list=20is=20safe=20w.r.t.=20= KEEP-ORDER.=0A(regexp-opt--contains-prefix):=20Remove.=0A=0A*=20= test/lisp/emacs-lisp/regexp-opt-tests.el:=20Use=20lexical-binding.=0A= (regexp-opt-test--permutation,=20regexp-opt-test--factorial)=0A= (regexp-opt-test--permutations,=20regexp-opt-test--match-all)=0A= (regexp-opt-test--check-perm,=20regexp-opt-test--explain-perm)=0A= (regexp-opt-keep-order):=20Test=20KEEP-ORDER.=0A---=0A=20= lisp/emacs-lisp/regexp-opt.el=20=20=20=20=20=20=20=20=20=20=20=20|=2045=20= ++++++++---------=0A=20test/lisp/emacs-lisp/regexp-opt-tests.el=20|=2062=20= +++++++++++++++++++++++-=0A=202=20files=20changed,=2082=20insertions(+),=20= 25=20deletions(-)=0A=0Adiff=20--git=20a/lisp/emacs-lisp/regexp-opt.el=20= b/lisp/emacs-lisp/regexp-opt.el=0Aindex=20b6104f22e7..8afb0c08db=20= 100644=0A---=20a/lisp/emacs-lisp/regexp-opt.el=0A+++=20= b/lisp/emacs-lisp/regexp-opt.el=0A@@=20-140,21=20+140,33=20@@=20= regexp-opt=0A=20=09=20=20=20(completion-ignore-case=20nil)=0A=20=09=20=20= =20(completion-regexp-list=20nil)=0A=20=09=20=20=20(open=20(cond=20= ((stringp=20paren)=20paren)=20(paren=20"\\(")))=0A-=09=20=20=20= (sorted-strings=20(delete-dups=0A-=09=09=09=20=20=20=20(sort=20= (copy-sequence=20strings)=20'string-lessp)))=0A=20=09=20=20=20(re=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20(cond=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20No=20strings:=20return=20an=20unmatchable=20regexp.=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20((null=20strings)=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(concat=20(or=20open=20"\\(?:")=20= regexp-unmatchable=20"\\)"))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20If=20we=20cannot=20reorder,=20give=20up=20all=20attempts=20at=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20optimisation.=20=20There=20is=20= room=20for=20improvement=20(Bug#34641).=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20((and=20keep-order=20(regexp-opt--contains-prefix=20= sorted-strings))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20= (or=20open=20"\\(?:")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(mapconcat=20#'regexp-quote=20strings=20"\\|")=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"\\)"))=0A+=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20algorithm=20will=20= generate=20a=20pattern=20that=20matches=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20longer=20strings=20in=20the=20list=20before=20shorter.=20=20= If=20the=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20list=20order=20= matters,=20then=20no=20string=20must=20come=20after=20a=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20proper=20prefix=20of=20that=20string.=20=20= To=20check=20this,=20verify=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= that=20a=20straight=20or-pattern=20matches=20each=20string=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20entirely.=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20((and=20keep-order=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(let*=20((case-fold-search=20nil)=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(alts=20= (mapconcat=20#'regexp-quote=20strings=20"\\|")))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(and=20(save-match-data=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(let=20((s=20strings))=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(while=20(and=20s=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=20=20=20=20=20=20=20=20=20(string-match=20alts=20(car=20= s))=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=20=20=20=20=20=20=20=20=20(=3D=20= (match-end=200)=20(length=20(car=20s))))=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(setq=20= s=20(cdr=20s)))=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=20s))=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(concat=20(or=20open=20= "\\(?:")=20alts=20"\\)")))))=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(regexp-opt-group=20= sorted-strings=20(or=20open=20t)=20(not=20open))))))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(regexp-opt-group=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(delete-dups=20(sort=20(copy-sequence=20strings)=20= 'string-lessp))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= open=20t)=20(not=20open))))))=0A=20=20=20=20=20=20=20(cond=20((eq=20= paren=20'words)=0A=20=09=20=20=20=20=20(concat=20"\\<"=20re=20"\\>"))=0A=20= =09=20=20=20=20((eq=20paren=20'symbols)=0A@@=20-339,21=20+351,6=20@@=20= regexp-opt-charset=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20= "["=20all=20"]")))))))=0A=20=0A=20=0A-(defun=20= regexp-opt--contains-prefix=20(strings)=0A-=20=20"Whether=20STRINGS=20= contains=20a=20proper=20prefix=20of=20one=20of=20its=20other=20elements.=0A= -STRINGS=20must=20be=20a=20list=20of=20sorted=20strings=20without=20= duplicates."=0A-=20=20(let=20((s=20strings))=0A-=20=20=20=20;;=20In=20a=20= lexicographically=20sorted=20list,=20a=20string=20always=20immediately=0A= -=20=20=20=20;;=20succeeds=20one=20of=20its=20prefixes.=0A-=20=20=20=20= (while=20(and=20(cdr=20s)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(not=20(string-equal=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(car=20s)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(substring=20(cadr=20s)=200=20(min=20(length=20= (car=20s))=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=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(length=20(cadr=20s)))))))=0A-=20=20=20=20=20=20(setq=20s=20= (cdr=20s)))=0A-=20=20=20=20(cdr=20s)))=0A-=0A-=0A=20(provide=20= 'regexp-opt)=0A=20=0A=20;;;=20regexp-opt.el=20ends=20here=0Adiff=20--git=20= a/test/lisp/emacs-lisp/regexp-opt-tests.el=20= b/test/lisp/emacs-lisp/regexp-opt-tests.el=0Aindex=20= 927de8c6a5..3658964faa=20100644=0A---=20= a/test/lisp/emacs-lisp/regexp-opt-tests.el=0A+++=20= b/test/lisp/emacs-lisp/regexp-opt-tests.el=0A@@=20-1,4=20+1,4=20@@=0A= -;;;=20regexp-opt-tests.el=20---=20Tests=20for=20regexp-opt.el=0A+;;;=20= regexp-opt-tests.el=20---=20Tests=20for=20regexp-opt.el=20=20-*-=20= lexical-binding:=20t=20-*-=0A=20=0A=20;;=20Copyright=20(C)=202013-2019=20= Free=20Software=20Foundation,=20Inc.=0A=20=0A@@=20-25,6=20+25,66=20@@=0A=20= =0A=20(require=20'regexp-opt)=0A=20=0A+(defun=20= regexp-opt-test--permutation=20(n=20list)=0A+=20=20"The=20Nth=20= permutation=20of=20LIST,=200=20=E2=89=A4=20N=20<=20(length=20LIST)!."=0A= +=20=20(let=20((len=20(length=20list))=0A+=20=20=20=20=20=20=20=20= (perm-list=20nil))=0A+=20=20=20=20(dotimes=20(i=20len)=0A+=20=20=20=20=20= =20(let*=20((d=20(-=20len=20i))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (k=20(mod=20n=20d)))=0A+=20=20=20=20=20=20=20=20(push=20(nth=20k=20list)=20= perm-list)=0A+=20=20=20=20=20=20=20=20(setq=20list=20(append=20(butlast=20= list=20(-=20(length=20list)=20k))=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(nthcdr=20(1+=20k)=20= list)))=0A+=20=20=20=20=20=20=20=20(setq=20n=20(/=20n=20d))))=0A+=20=20=20= =20(nreverse=20perm-list)))=0A+=0A+(defun=20regexp-opt-test--factorial=20= (n)=0A+=20=20"N!"=0A+=20=20(apply=20#'*=20(number-sequence=201=20n)))=0A= +=0A+(defun=20regexp-opt-test--permutations=20(list)=0A+=20=20"All=20= permutations=20of=20LIST."=0A+=20=20(mapcar=20(lambda=20(i)=20= (regexp-opt-test--permutation=20i=20list))=0A+=20=20=20=20=20=20=20=20=20= =20(number-sequence=200=20(1-=20(regexp-opt-test--factorial=20(length=20= list))))))=0A+=0A+(defun=20regexp-opt-test--match-all=20(words=20re)=0A+=20= =20(mapcar=20(lambda=20(w)=20(and=20(string-match=20re=20w)=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= (match-string=200=20w)))=0A+=20=20=20=20=20=20=20=20=20=20words))=0A+=0A= +(defun=20regexp-opt-test--check-perm=20(perm)=0A+=20=20(let*=20((ref-re=20= (mapconcat=20#'regexp-quote=20perm=20"\\|"))=0A+=20=20=20=20=20=20=20=20=20= (opt-re=20(regexp-opt=20perm=20nil=20t))=0A+=20=20=20=20=20=20=20=20=20= (ref=20(regexp-opt-test--match-all=20perm=20ref-re))=0A+=20=20=20=20=20=20= =20=20=20(opt=20(regexp-opt-test--match-all=20perm=20opt-re)))=0A+=20=20=20= =20(equal=20opt=20ref)))=0A+=0A+(defun=20regexp-opt-test--explain-perm=20= (perm)=0A+=20=20(let*=20((ref-re=20(mapconcat=20#'regexp-quote=20perm=20= "\\|"))=0A+=20=20=20=20=20=20=20=20=20(opt-re=20(regexp-opt=20perm=20nil=20= t))=0A+=20=20=20=20=20=20=20=20=20(ref=20(regexp-opt-test--match-all=20= perm=20ref-re))=0A+=20=20=20=20=20=20=20=20=20(opt=20= (regexp-opt-test--match-all=20perm=20opt-re)))=0A+=20=20=20=20(concat=20= "\n"=0A+=20=20=20=20=20=20=20=20=20=20=20=20(format=20"Na=C3=AFve=20= regexp:=20=20=20=20=20%s\n"=20ref-re)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20(format=20"Optimised=20regexp:=20%s\n"=20opt-re)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20(format=20"Got:=20=20=20=20=20=20%s\n"=20opt)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20(format=20"Expected:=20%s\n"=20ref))))=0A+=0A= +(put=20'regexp-opt-test--check-perm=20'ert-explainer=20= 'regexp-opt-test--explain-perm)=0A+=0A+(ert-deftest=20= regexp-opt-keep-order=20()=0A+=20=20"Check=20that=20KEEP-ORDER=20works."=0A= +=20=20(dolist=20(perm=20(regexp-opt-test--permutations=20'("abc"=20= "bca"=20"cab")))=0A+=20=20=20=20(should=20(regexp-opt-test--check-perm=20= perm)))=0A+=20=20(dolist=20(perm=20(regexp-opt-test--permutations=20= '("abc"=20"ab"=20"bca"=20"bc")))=0A+=20=20=20=20(should=20= (regexp-opt-test--check-perm=20perm)))=0A+=20=20(dolist=20(perm=20= (regexp-opt-test--permutations=20'("abxy"=20"cdxy")))=0A+=20=20=20=20= (should=20(regexp-opt-test--check-perm=20perm)))=0A+=20=20(dolist=20= (perm=20(regexp-opt-test--permutations=20'("afgx"=20"bfgx"=20"afgy"=20= "bfgy")))=0A+=20=20=20=20(should=20(regexp-opt-test--check-perm=20= perm)))=0A+=20=20(dolist=20(perm=20(regexp-opt-test--permutations=20= '("a"=20"ab"=20"ac"=20"abc")))=0A+=20=20=20=20(should=20= (regexp-opt-test--check-perm=20perm))))=0A+=0A=20(ert-deftest=20= regexp-opt-charset=20()=0A=20=20=20(should=20(equal=20= (regexp-opt-charset=20'(?a=20?b=20?a))=20"[ab]"))=0A=20=20=20(should=20= (equal=20(regexp-opt-charset=20'(?D=20?d=20?B=20?a=20?b=20?C=20?7=20?a=20= ?c=20?A))=0A--=20=0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357-- From unknown Sun Jun 22 07:39:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jul 2019 19:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36444 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Cc: 36444@debbugs.gnu.org Received: via spool by 36444-submit@debbugs.gnu.org id=B36444.156218218331693 (code B ref 36444); Wed, 03 Jul 2019 19:30:02 +0000 Received: (at 36444) by debbugs.gnu.org; 3 Jul 2019 19:29:43 +0000 Received: from localhost ([127.0.0.1]:50104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hikwp-0008F7-6V for submit@debbugs.gnu.org; Wed, 03 Jul 2019 15:29:43 -0400 Received: from mail-io1-f44.google.com ([209.85.166.44]:45635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hikwm-0008Es-Q8 for 36444@debbugs.gnu.org; Wed, 03 Jul 2019 15:29:41 -0400 Received: by mail-io1-f44.google.com with SMTP id e3so7207481ioc.12 for <36444@debbugs.gnu.org>; Wed, 03 Jul 2019 12:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=5X5Jx80KEFWaNHNXaekN4sUuVWe9G/y+7VeHRb4w/Hc=; b=kyNwB901BxSCXPs9ieZn2gLW9UCyVJigVTpzSxnpHqxSLLK8UCykQyaSvyZgl9dyY4 Nh8IWRBAPnzN3+YXsIaJhzSMXWs6l4oIketsUx1mTDqPwNKcT/d+KBYTc6V4X6WihY1a xAHkfum2F+fDFL7RZmr2vOksXOWNG97GV2DSzyBNBKGp6i44uFhSkaw8vCT90ni+eA6d izeLnP6zgMJpdYr+Hd0MlfckwqXHb3o/xRnOA/1TTRw75WBeXyOIH3MHzWR28xUewClT HU8fseKyV2nNxVLJ7n+dMJCQb+au0Xl4qB3Ly6B3keIEaOomUspK1L2kHGABzljpj2Ax Flfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=5X5Jx80KEFWaNHNXaekN4sUuVWe9G/y+7VeHRb4w/Hc=; b=LC/PMW2KmpwNMBqfifZZ1yPi/FlYZDwjmiGmRz1xnzM3IKh9XzwyVmVAN7vKMxUABg bzTNgn1jLSIPPubb0DInnvxi1rp6K1Hu3gCcxJphRAjYKo/TQdA0L4wCpWbBcuVkLvNA W+Mq9eFumbIDqwXujNm/OdO5Aw9KjnIzaV/gx6JMyQU3cCvD9xpKMVPtGuI8fayoKjUW YmdDPdMFAJmgnH0/3EEUaXxcdTOj70BxDYsrF5rIAR5m+SDiGI+z338iMffCjhNIoD7A 4cZxV/S7j1qmuM7GvqqwW7cbn44NosbcvdSQ6DVC9LYMewW37Dl/iU2ytGU6f2kVdIN0 bA0w== X-Gm-Message-State: APjAAAUJYGrPrsoipSS+ixdaFrMY7zGh+MXGbr085x1Vuw//MxhJdFwx Bs0D8uPuqka65dFb+JF0Od9cKsxC X-Google-Smtp-Source: APXvYqyYXwiCPchrymrP9KN4IOKOwSthigYjLu1pIqCqLf4xFo1WVg4RalWjV1gGQbpW2MeMQ1WndA== X-Received: by 2002:a02:aa1d:: with SMTP id r29mr22796419jam.127.1562182174878; Wed, 03 Jul 2019 12:29:34 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id a2sm2765808iod.57.2019.07.03.12.29.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Jul 2019 12:29:33 -0700 (PDT) From: Noam Postavsky References: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> Date: Wed, 03 Jul 2019 15:29:33 -0400 In-Reply-To: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> ("Mattias \=\?iso-8859-1\?Q\?Engdeg\=E5rd\=22's\?\= message of "Sun, 30 Jun 2019 14:28:57 +0200") Message-ID: <85v9wiex2a.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=E5rd writes: > + ;; The algorithm will generate a pattern that matches > + ;; longer strings in the list before shorter. If the > + ;; list order matters, then no string must come after a > + ;; proper prefix of that string. To check this, verify > + ;; that a straight or-pattern matches each string > + ;; entirely. > + ((and keep-order > + (let* ((case-fold-search nil) > + (alts (mapconcat #'regexp-quote strings "\\|")= )) > + (and (save-match-data You don't actually need this save-match-data, right? Because there is already one at the top level of the function (which I'm also not sure is really needed, but probably best not to touch that). > + (let ((s strings)) > + (while (and s > + (string-match alts (car s)) > + (=3D (match-end 0) (length (ca= r s)))) > + (setq s (cdr s))) > + s)) > + (concat (or open "\\(?:") alts "\\)"))))) IMO, a dolist + catch & throw would be a bit more readable; it took me some puzzling to realize that the early exit was the "non-optimized" case. (and keep-order (let* ((case-fold-search nil) (alts (mapconcat #'regexp-quote strings "\\|"))) (and (catch 'has-prefix (dolist (s strings) (unless (and (string-match alts s) (=3D (match-end 0) (length s))) (throw 'has-prefix s)))) (concat (or open "\\(?:") alts "\\)")))) From unknown Sun Jun 22 07:39:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2019 11:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36444 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Noam Postavsky Cc: 36444@debbugs.gnu.org Received: via spool by 36444-submit@debbugs.gnu.org id=B36444.156224116529947 (code B ref 36444); Thu, 04 Jul 2019 11:53:01 +0000 Received: (at 36444) by debbugs.gnu.org; 4 Jul 2019 11:52:45 +0000 Received: from localhost ([127.0.0.1]:50482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj0I9-0007mx-8z for submit@debbugs.gnu.org; Thu, 04 Jul 2019 07:52:45 -0400 Received: from mail1424c50.megamailservers.eu ([91.136.14.24]:51286 helo=mail102c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj0I6-0007mh-8s for 36444@debbugs.gnu.org; Thu, 04 Jul 2019 07:52:44 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1562241155; bh=+4tXxyZVO7DgP6gRY8PENsDc32I4gDC1mi+mJPMfPVg=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=j7mSigOO/K+ukCuhbuU4wJrr76JvNsN8Z0iL4v4nuxDrK1A/eFZ9AF0//gEr0tKXs NhLa7Jyj/Jz3AYOiaK7/Wy6AlkRON8DDhLNa0i2pXyxBlId+oh4kw5Y20qrSVa/voE p1TqLQuolTYbXzRXdQ0aQjt21hvxRaODivfrDEbA= Feedback-ID: mattiase@acm.or Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail102c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x64BqWMQ025112; Thu, 4 Jul 2019 11:52:34 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <85v9wiex2a.fsf@gmail.com> Date: Thu, 4 Jul 2019 13:52:31 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <74D2BB46-AE27-4F7B-8E76-E12527834B53@acm.org> References: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> <85v9wiex2a.fsf@gmail.com> X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0205.5D1DE883.0036, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=RfS+9Wlv c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=IKg0c7FWY9yppsr4vyAA:9 a=wXfZdyDHUFKTr466:21 a=z7UTTEmDI5PgOhj1:21 a=CjuIK1q_8ugA:10 X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) 3 juli 2019 kl. 21.29 skrev Noam Postavsky : >=20 > You don't actually need this save-match-data, right? Because there is > already one at the top level of the function (which I'm also not sure = is > really needed, but probably best not to touch that). Thank you! I don't know how I missed the existing save-match-data. = Removed. > IMO, a dolist + catch & throw would be a bit more readable; it took me > some puzzling to realize that the early exit was the "non-optimized" > case. >=20 > (and keep-order > (let* ((case-fold-search nil) > (alts (mapconcat #'regexp-quote strings "\\|"))) > (and (catch 'has-prefix > (dolist (s strings) > (unless (and (string-match alts s) > (=3D (match-end 0) (length s))) > (throw 'has-prefix s)))) > (concat (or open "\\(?:") alts "\\)")))) Not too fond of that either, really; catch/throw somehow seems more = heavyweight than warranted by the situation. Initially I used cl-every, but ran into the usual bootstrap problems. Here are two alternatives: (1) Same as before, but with a comment about what tripped you up: > (and (let ((s strings)) > (while (and s > (string-match alts (car s)) > (=3D (match-end 0) (length (car s)))) > (setq s (cdr s))) > ;; If we exited early, we found evidence that > ;; regexp-opt-group cannot be used. > s) > (concat (or open "\\(?:") alts "\\)"))))) (2) Using cl-loop: > (and (not (cl-loop > for s in strings > always (and (string-match alts s) > (=3D (match-end 0) (length s))))) > (concat (or open "\\(?:") alts "\\)"))))) From unknown Sun Jun 22 07:39:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2019 14:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36444 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Cc: Noam Postavsky , 36444@debbugs.gnu.org Received: via spool by 36444-submit@debbugs.gnu.org id=B36444.156224990328455 (code B ref 36444); Thu, 04 Jul 2019 14:19:01 +0000 Received: (at 36444) by debbugs.gnu.org; 4 Jul 2019 14:18:23 +0000 Received: from localhost ([127.0.0.1]:51685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj2Z5-0007Ot-1E for submit@debbugs.gnu.org; Thu, 04 Jul 2019 10:18:23 -0400 Received: from mail-io1-f53.google.com ([209.85.166.53]:47044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj2Z3-0007Oe-3Y for 36444@debbugs.gnu.org; Thu, 04 Jul 2019 10:18:21 -0400 Received: by mail-io1-f53.google.com with SMTP id i10so13053698iol.13 for <36444@debbugs.gnu.org>; Thu, 04 Jul 2019 07:18:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=dPOgPlwR3QJTedEe/yU9vfSa6SmJ5ZmLVKmvODLiIDg=; b=eHJZvPpkBnVRbHsnbNNfhmUAqLFUQX4CWuEPLMCaGZIxsIvDwzhiMrrc1p6s7UMLLm r7yofJ9a/CvkZw8fuVWJXoM8N5ESrV95LdiMGLQ/9SWCo6yzwYqW3y9e4yFi9bNsFNnB IxitKTQlYaGBuqNdIs4FlW5HHUFkttmYTygIQD9NaIKNzvgU+x4gE74co2v8E3mI2D/j zCDvgMSSU8K32wqgdBZcniLyGCF9Bubasc0Fp73VeUMEk6TeVZP45IkaMsGy/53g/4L5 96GxUrI4KrtEkSMjCFHGWVMb7b8cvgthlw7Q3JusVuD6J8uz0LL87uq+aj0uhGOoipgH Upew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=dPOgPlwR3QJTedEe/yU9vfSa6SmJ5ZmLVKmvODLiIDg=; b=KQGUIM28gyCJ8XPH2vwkrJoopwFtX+itjsROiQmNpBnsuFkXCwwMlVVD0lAljiDF4K jmbZWHKC9rk30RC/ytoebTYU7odMc09d6iqTZvAEglSJ0kMYdm2J/taujY7cPaLridV7 HWho3Ls1ZMlwheJanO06jKYoRDkYCkd+38Dnxf0SEeqmlNtENOMyLd+FFaiJL5M8YfpY YR6EGx2CMALuNgyPrlpUgHlNaMg3VNCrAywRwilYjYc8W34k/7JkZZYaXivfPZuv36Hs 0pGAA8dErT/yaOoVqvZ846eHwJXNborYOgkQ0kC07sFhPLvzQZdJu5M8cVm1OE4qqDDM GOCg== X-Gm-Message-State: APjAAAXla5sfd2s2YEG4umGXLQ4NKkHNQauqXF2GL0rp/q+KPHKm83XS iE3CpkG56YvcZ/SErk+EObavjMqZ X-Google-Smtp-Source: APXvYqw9Uufid3tkcqEexz+QuZ/A6BGuuro2rZty1jLp9LaGwjCBquB3DB+yumGQBv+UEGlT/kDhxQ== X-Received: by 2002:a02:b00f:: with SMTP id p15mr6715543jah.49.1562249891467; Thu, 04 Jul 2019 07:18:11 -0700 (PDT) Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id t5sm4426971iol.55.2019.07.04.07.18.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jul 2019 07:18:11 -0700 (PDT) From: Noam Postavsky References: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> <85v9wiex2a.fsf@gmail.com> <74D2BB46-AE27-4F7B-8E76-E12527834B53@acm.org> Date: Thu, 04 Jul 2019 10:18:11 -0400 In-Reply-To: <74D2BB46-AE27-4F7B-8E76-E12527834B53@acm.org> ("Mattias \=\?iso-8859-1\?Q\?Engdeg\=E5rd\=22's\?\= message of "Thu, 4 Jul 2019 13:52:31 +0200") Message-ID: <85sgrlevdo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) Mattias Engdeg=E5rd writes: > Not too fond of that either, really; catch/throw somehow seems more > heavyweight than warranted by the situation. I've wondered if it's worth making a lexical variant of catch/throw that could be compiled as goto for these kind of situations. > (1) Same as before, but with a comment about what tripped you up: > (2) Using cl-loop: Assuming (eval-when-compile (require 'cl-lib)) avoids bootstapping problems, I think the cl-loop variant is a bit neater; but either way is fine with me. From unknown Sun Jun 22 07:39:16 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Subject: bug#36444: closed (Re: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check) Message-ID: References: <9C8D8AE9-8B8B-4428-BC79-BEB82BC3E3A3@acm.org> <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> X-Gnu-PR-Message: they-closed 36444 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 36444@debbugs.gnu.org Date: Thu, 04 Jul 2019 15:19:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1562253542-9785-1" This is a multi-part message in MIME format... ------------=_1562253542-9785-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #36444: [PATCH] Improved regexp-opt KEEP-ORDER check which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 36444@debbugs.gnu.org. --=20 36444: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36444 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1562253542-9785-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 36444-done) by debbugs.gnu.org; 4 Jul 2019 15:18:47 +0000 Received: from localhost ([127.0.0.1]:51722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj3VX-0002XM-Jb for submit@debbugs.gnu.org; Thu, 04 Jul 2019 11:18:47 -0400 Received: from mail227c50.megamailservers.eu ([91.136.10.237]:58424 helo=mail36c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj3VU-0002XC-Gb for 36444-done@debbugs.gnu.org; Thu, 04 Jul 2019 11:18:45 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1562253522; bh=SaA6i8e+I0TvmN1BJ9xEU2AZcjDDPfXwz6q9we3UeuE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=mmXTuvkObcq4IF7RtRZHySDlOIg/8EZSEe2sho7Wudq8irEr6WDz5MEr+jOz3Fx4Q MU2nCPnYTy7d+z9twtXNGiPwC9jnWrbm7EvJ+ydIZ2Hd3iGw70d4IZ5RMYAFA8Z7C8 pF8Khq1arbJVziPuEgwnPL0bhr7wIvOqzfSv0/9s= Feedback-ID: mattiase@acm.or Received: from [192.168.1.64] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail36c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x64FIeUw031042; Thu, 4 Jul 2019 15:18:42 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <85sgrlevdo.fsf@gmail.com> Date: Thu, 4 Jul 2019 17:18:40 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9C8D8AE9-8B8B-4428-BC79-BEB82BC3E3A3@acm.org> References: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> <85v9wiex2a.fsf@gmail.com> <74D2BB46-AE27-4F7B-8E76-E12527834B53@acm.org> <85sgrlevdo.fsf@gmail.com> To: Noam Postavsky X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0215.5D1E18D2.0066, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=BtuzP7f5 c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=8cXiXC9NtpSe86jUhhQA:9 a=CjuIK1q_8ugA:10 X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 36444-done Cc: 36444-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 4 juli 2019 kl. 16.18 skrev Noam Postavsky : >=20 >> Not too fond of that either, really; catch/throw somehow seems more >> heavyweight than warranted by the situation. >=20 > I've wondered if it's worth making a lexical variant of catch/throw = that > could be compiled as goto for these kind of situations. Yes, although in this case I'd settle for built-in some/every constructs = without bootstrap trouble, or list comprehensions that aren't a = mysterious corner of cl-loop. >> (1) Same as before, but with a comment about what tripped you up: >=20 >> (2) Using cl-loop: >=20 > Assuming (eval-when-compile (require 'cl-lib)) avoids bootstapping > problems, I think the cl-loop variant is a bit neater; but either way = is > fine with me. Thank you; I went with the while-loop, on the grounds that it can be = readily understood by the layman from first principles. I have yet to be = entirely friends with cl-loop. Pushed to master. ------------=_1562253542-9785-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Jun 2019 12:29:19 +0000 Received: from localhost ([127.0.0.1]:45464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhYxL-0001Vy-Gn for submit@debbugs.gnu.org; Sun, 30 Jun 2019 08:29:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:37438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hhYxJ-0001Vq-Cv for submit@debbugs.gnu.org; Sun, 30 Jun 2019 08:29:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36694) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hhYxI-0005lx-Hr for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 08:29:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hhYxH-00061M-Jd for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 08:29:16 -0400 Received: from mail205c50.megamailservers.eu ([91.136.10.215]:36430 helo=mail193c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hhYxH-0005mo-0V for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2019 08:29:15 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1561897740; bh=gm9T1VDSqK7MIsyvaU6Bbsf39+oM9y3CpwQGDOklcZY=; h=From:Subject:Date:To:From; b=qoKDwZBuBHgTUyGLDZxVpZ1xobAG60q+ysMAkdkebBemUUHwEFtUIgsVcmufdcETy 5/h/SIrnORmbFqGxHvxMrbuV95CNpcm2kr19YHNxwgg7yJpsT9v01NZqrQ/UlfjkWU Nus/vC8Sgyna/ubwQw7e4bLMvTyXn5QeZu6Z/R94= Feedback-ID: mattiase@acm.or Received: from [192.168.1.65] (c-e636e253.032-75-73746f71.bbcust.telenor.se [83.226.54.230]) (authenticated bits=0) by mail193c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x5UCSv1D009634 for ; Sun, 30 Jun 2019 12:29:00 +0000 From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [PATCH] Improved regexp-opt KEEP-ORDER check Message-Id: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> Date: Sun, 30 Jun 2019 14:28:57 +0200 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020F.5D18AB0C.0048, 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-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=KsZjJ1eN c=1 sm=1 tr=0 a=M+GU/qJco4WXjv8D6jB2IA==:117 a=M+GU/qJco4WXjv8D6jB2IA==:17 a=lvMLtnk2CsVkxFO_dGUA:9 a=CjuIK1q_8ugA:10 a=s2lJpgmBrr0SaIv6U2UA: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.215 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Currently, regexp-opt does not attempt optimisation with KEEP-ORDER set = if the input list contains a proper prefix of another element, like ("ab" "abcd") on the grounds that the optimised string would be "ab\\(?:cd\\)?" which would not preserve the match order. However, this also prevents ("abcd" "ab") from being optimised, even though doing so would be harmless. The attached patch strengthens the check, allowing more inputs to be = optimised. --Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357 Content-Disposition: attachment; filename=0001-Optimise-more-inputs-to-regexp-opt.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Optimise-more-inputs-to-regexp-opt.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ee29b82719c6ca40b3ff9054fcbf4e964ed18ad3=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=2030=20Jun=202019=2012:53:52=20+0200=0A= Subject:=20[PATCH]=20Optimise=20more=20inputs=20to=20`regexp-opt'=0A=0A= Use=20a=20more=20precise=20test=20to=20determine=20whether=20the=20input=20= to=20`regexp-opt'=0Ais=20safe=20to=20optimise=20when=20KEEP-ORDER=20is=20= non-nil,=20permitting=20more=20inputs=0Ato=20be=20optimised=20than=20= before.=20=20For=20example,=20("good"=20"goal"=20"go")=20is=20now=0A= accepted.=0A=0A*=20lisp/emacs-lisp/regexp-opt.el=20(regexp-opt):=0AMore=20= precise=20test=20for=20whether=20the=20list=20is=20safe=20w.r.t.=20= KEEP-ORDER.=0A(regexp-opt--contains-prefix):=20Remove.=0A=0A*=20= test/lisp/emacs-lisp/regexp-opt-tests.el:=20Use=20lexical-binding.=0A= (regexp-opt-test--permutation,=20regexp-opt-test--factorial)=0A= (regexp-opt-test--permutations,=20regexp-opt-test--match-all)=0A= (regexp-opt-test--check-perm,=20regexp-opt-test--explain-perm)=0A= (regexp-opt-keep-order):=20Test=20KEEP-ORDER.=0A---=0A=20= lisp/emacs-lisp/regexp-opt.el=20=20=20=20=20=20=20=20=20=20=20=20|=2045=20= ++++++++---------=0A=20test/lisp/emacs-lisp/regexp-opt-tests.el=20|=2062=20= +++++++++++++++++++++++-=0A=202=20files=20changed,=2082=20insertions(+),=20= 25=20deletions(-)=0A=0Adiff=20--git=20a/lisp/emacs-lisp/regexp-opt.el=20= b/lisp/emacs-lisp/regexp-opt.el=0Aindex=20b6104f22e7..8afb0c08db=20= 100644=0A---=20a/lisp/emacs-lisp/regexp-opt.el=0A+++=20= b/lisp/emacs-lisp/regexp-opt.el=0A@@=20-140,21=20+140,33=20@@=20= regexp-opt=0A=20=09=20=20=20(completion-ignore-case=20nil)=0A=20=09=20=20= =20(completion-regexp-list=20nil)=0A=20=09=20=20=20(open=20(cond=20= ((stringp=20paren)=20paren)=20(paren=20"\\(")))=0A-=09=20=20=20= (sorted-strings=20(delete-dups=0A-=09=09=09=20=20=20=20(sort=20= (copy-sequence=20strings)=20'string-lessp)))=0A=20=09=20=20=20(re=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20(cond=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20No=20strings:=20return=20an=20unmatchable=20regexp.=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20((null=20strings)=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(concat=20(or=20open=20"\\(?:")=20= regexp-unmatchable=20"\\)"))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20If=20we=20cannot=20reorder,=20give=20up=20all=20attempts=20at=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20optimisation.=20=20There=20is=20= room=20for=20improvement=20(Bug#34641).=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20((and=20keep-order=20(regexp-opt--contains-prefix=20= sorted-strings))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20= (or=20open=20"\\(?:")=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(mapconcat=20#'regexp-quote=20strings=20"\\|")=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"\\)"))=0A+=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20The=20algorithm=20will=20= generate=20a=20pattern=20that=20matches=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=20longer=20strings=20in=20the=20list=20before=20shorter.=20=20= If=20the=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20list=20order=20= matters,=20then=20no=20string=20must=20come=20after=20a=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20proper=20prefix=20of=20that=20string.=20=20= To=20check=20this,=20verify=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= that=20a=20straight=20or-pattern=20matches=20each=20string=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20;;=20entirely.=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20((and=20keep-order=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(let*=20((case-fold-search=20nil)=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(alts=20= (mapconcat=20#'regexp-quote=20strings=20"\\|")))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(and=20(save-match-data=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(let=20((s=20strings))=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(while=20(and=20s=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=20=20=20=20=20=20=20=20=20(string-match=20alts=20(car=20= s))=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=20=20=20=20=20=20=20=20=20(=3D=20= (match-end=200)=20(length=20(car=20s))))=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(setq=20= s=20(cdr=20s)))=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=20s))=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(concat=20(or=20open=20= "\\(?:")=20alts=20"\\)")))))=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(regexp-opt-group=20= sorted-strings=20(or=20open=20t)=20(not=20open))))))=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(regexp-opt-group=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(delete-dups=20(sort=20(copy-sequence=20strings)=20= 'string-lessp))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= open=20t)=20(not=20open))))))=0A=20=20=20=20=20=20=20(cond=20((eq=20= paren=20'words)=0A=20=09=20=20=20=20=20(concat=20"\\<"=20re=20"\\>"))=0A=20= =09=20=20=20=20((eq=20paren=20'symbols)=0A@@=20-339,21=20+351,6=20@@=20= regexp-opt-charset=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20= "["=20all=20"]")))))))=0A=20=0A=20=0A-(defun=20= regexp-opt--contains-prefix=20(strings)=0A-=20=20"Whether=20STRINGS=20= contains=20a=20proper=20prefix=20of=20one=20of=20its=20other=20elements.=0A= -STRINGS=20must=20be=20a=20list=20of=20sorted=20strings=20without=20= duplicates."=0A-=20=20(let=20((s=20strings))=0A-=20=20=20=20;;=20In=20a=20= lexicographically=20sorted=20list,=20a=20string=20always=20immediately=0A= -=20=20=20=20;;=20succeeds=20one=20of=20its=20prefixes.=0A-=20=20=20=20= (while=20(and=20(cdr=20s)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(not=20(string-equal=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(car=20s)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(substring=20(cadr=20s)=200=20(min=20(length=20= (car=20s))=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=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(length=20(cadr=20s)))))))=0A-=20=20=20=20=20=20(setq=20s=20= (cdr=20s)))=0A-=20=20=20=20(cdr=20s)))=0A-=0A-=0A=20(provide=20= 'regexp-opt)=0A=20=0A=20;;;=20regexp-opt.el=20ends=20here=0Adiff=20--git=20= a/test/lisp/emacs-lisp/regexp-opt-tests.el=20= b/test/lisp/emacs-lisp/regexp-opt-tests.el=0Aindex=20= 927de8c6a5..3658964faa=20100644=0A---=20= a/test/lisp/emacs-lisp/regexp-opt-tests.el=0A+++=20= b/test/lisp/emacs-lisp/regexp-opt-tests.el=0A@@=20-1,4=20+1,4=20@@=0A= -;;;=20regexp-opt-tests.el=20---=20Tests=20for=20regexp-opt.el=0A+;;;=20= regexp-opt-tests.el=20---=20Tests=20for=20regexp-opt.el=20=20-*-=20= lexical-binding:=20t=20-*-=0A=20=0A=20;;=20Copyright=20(C)=202013-2019=20= Free=20Software=20Foundation,=20Inc.=0A=20=0A@@=20-25,6=20+25,66=20@@=0A=20= =0A=20(require=20'regexp-opt)=0A=20=0A+(defun=20= regexp-opt-test--permutation=20(n=20list)=0A+=20=20"The=20Nth=20= permutation=20of=20LIST,=200=20=E2=89=A4=20N=20<=20(length=20LIST)!."=0A= +=20=20(let=20((len=20(length=20list))=0A+=20=20=20=20=20=20=20=20= (perm-list=20nil))=0A+=20=20=20=20(dotimes=20(i=20len)=0A+=20=20=20=20=20= =20(let*=20((d=20(-=20len=20i))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (k=20(mod=20n=20d)))=0A+=20=20=20=20=20=20=20=20(push=20(nth=20k=20list)=20= perm-list)=0A+=20=20=20=20=20=20=20=20(setq=20list=20(append=20(butlast=20= list=20(-=20(length=20list)=20k))=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(nthcdr=20(1+=20k)=20= list)))=0A+=20=20=20=20=20=20=20=20(setq=20n=20(/=20n=20d))))=0A+=20=20=20= =20(nreverse=20perm-list)))=0A+=0A+(defun=20regexp-opt-test--factorial=20= (n)=0A+=20=20"N!"=0A+=20=20(apply=20#'*=20(number-sequence=201=20n)))=0A= +=0A+(defun=20regexp-opt-test--permutations=20(list)=0A+=20=20"All=20= permutations=20of=20LIST."=0A+=20=20(mapcar=20(lambda=20(i)=20= (regexp-opt-test--permutation=20i=20list))=0A+=20=20=20=20=20=20=20=20=20= =20(number-sequence=200=20(1-=20(regexp-opt-test--factorial=20(length=20= list))))))=0A+=0A+(defun=20regexp-opt-test--match-all=20(words=20re)=0A+=20= =20(mapcar=20(lambda=20(w)=20(and=20(string-match=20re=20w)=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= (match-string=200=20w)))=0A+=20=20=20=20=20=20=20=20=20=20words))=0A+=0A= +(defun=20regexp-opt-test--check-perm=20(perm)=0A+=20=20(let*=20((ref-re=20= (mapconcat=20#'regexp-quote=20perm=20"\\|"))=0A+=20=20=20=20=20=20=20=20=20= (opt-re=20(regexp-opt=20perm=20nil=20t))=0A+=20=20=20=20=20=20=20=20=20= (ref=20(regexp-opt-test--match-all=20perm=20ref-re))=0A+=20=20=20=20=20=20= =20=20=20(opt=20(regexp-opt-test--match-all=20perm=20opt-re)))=0A+=20=20=20= =20(equal=20opt=20ref)))=0A+=0A+(defun=20regexp-opt-test--explain-perm=20= (perm)=0A+=20=20(let*=20((ref-re=20(mapconcat=20#'regexp-quote=20perm=20= "\\|"))=0A+=20=20=20=20=20=20=20=20=20(opt-re=20(regexp-opt=20perm=20nil=20= t))=0A+=20=20=20=20=20=20=20=20=20(ref=20(regexp-opt-test--match-all=20= perm=20ref-re))=0A+=20=20=20=20=20=20=20=20=20(opt=20= (regexp-opt-test--match-all=20perm=20opt-re)))=0A+=20=20=20=20(concat=20= "\n"=0A+=20=20=20=20=20=20=20=20=20=20=20=20(format=20"Na=C3=AFve=20= regexp:=20=20=20=20=20%s\n"=20ref-re)=0A+=20=20=20=20=20=20=20=20=20=20=20= =20(format=20"Optimised=20regexp:=20%s\n"=20opt-re)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20(format=20"Got:=20=20=20=20=20=20%s\n"=20opt)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20(format=20"Expected:=20%s\n"=20ref))))=0A+=0A= +(put=20'regexp-opt-test--check-perm=20'ert-explainer=20= 'regexp-opt-test--explain-perm)=0A+=0A+(ert-deftest=20= regexp-opt-keep-order=20()=0A+=20=20"Check=20that=20KEEP-ORDER=20works."=0A= +=20=20(dolist=20(perm=20(regexp-opt-test--permutations=20'("abc"=20= "bca"=20"cab")))=0A+=20=20=20=20(should=20(regexp-opt-test--check-perm=20= perm)))=0A+=20=20(dolist=20(perm=20(regexp-opt-test--permutations=20= '("abc"=20"ab"=20"bca"=20"bc")))=0A+=20=20=20=20(should=20= (regexp-opt-test--check-perm=20perm)))=0A+=20=20(dolist=20(perm=20= (regexp-opt-test--permutations=20'("abxy"=20"cdxy")))=0A+=20=20=20=20= (should=20(regexp-opt-test--check-perm=20perm)))=0A+=20=20(dolist=20= (perm=20(regexp-opt-test--permutations=20'("afgx"=20"bfgx"=20"afgy"=20= "bfgy")))=0A+=20=20=20=20(should=20(regexp-opt-test--check-perm=20= perm)))=0A+=20=20(dolist=20(perm=20(regexp-opt-test--permutations=20= '("a"=20"ab"=20"ac"=20"abc")))=0A+=20=20=20=20(should=20= (regexp-opt-test--check-perm=20perm))))=0A+=0A=20(ert-deftest=20= regexp-opt-charset=20()=0A=20=20=20(should=20(equal=20= (regexp-opt-charset=20'(?a=20?b=20?a))=20"[ab]"))=0A=20=20=20(should=20= (equal=20(regexp-opt-charset=20'(?D=20?d=20?B=20?a=20?b=20?C=20?7=20?a=20= ?c=20?A))=0A--=20=0A2.20.1=20(Apple=20Git-117)=0A=0A= --Apple-Mail=_2FDB2CD4-5E7F-4C22-9EAD-033BA0D7F357-- ------------=_1562253542-9785-1-- From unknown Sun Jun 22 07:39:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#36444: [PATCH] Improved regexp-opt KEEP-ORDER check Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2019 16:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36444 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Noam Postavsky Cc: 36444-done@debbugs.gnu.org Received: via spool by 36444-done@debbugs.gnu.org id=D36444.156225611513950 (code D ref 36444); Thu, 04 Jul 2019 16:02:01 +0000 Received: (at 36444-done) by debbugs.gnu.org; 4 Jul 2019 16:01:55 +0000 Received: from localhost ([127.0.0.1]:51759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj4BF-0003cu-Ov for submit@debbugs.gnu.org; Thu, 04 Jul 2019 12:01:55 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:58594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj4BE-0003ce-Hk for 36444-done@debbugs.gnu.org; Thu, 04 Jul 2019 12:01:53 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x64G040V095466; Thu, 4 Jul 2019 16:01:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=tgQaxaMqH4jpX0Lh+GS782gPKvgiZu5/pbxuvIl4Koo=; b=2zL4jhJT8ioSE0zaSVFqcsT1tozg4i9ySGe2FSKlL7s8SkBJLAq8HBCKBDIehKO/aKT1 RCz+b2M2NHU8uhZrbjP/5ERq83ydPvYm6hpJtRe+Dq9A3/8PQ0l4xv9Rr8GFvItkMwMV ANaG5cwy8yiubXA7thlQGl6zdkZifrYyEjNBxWtq9nQyKtLH8O1R0TT6ClvyqN8Dj1+2 rGhJV+LYqVGqNuegCWkXLdR6hcizr7lG/Pe1JqzVJjlXcybvXoTvGwk7aGxZzrDDGAIz txPbgWO4QLeUMyFrU4AlcQZ4p0Xbvjt4VwFi3Z0qsIJXS77bPygwU2NdMm9FQP7+yZ7i gQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2te61efg2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 16:01:43 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x64FwTYv085251; Thu, 4 Jul 2019 16:01:43 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2th9ec1hw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Jul 2019 16:01:42 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x64G1eIH007323; Thu, 4 Jul 2019 16:01:42 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 4 Jul 2019 09:01:39 -0700 (PDT) From: Drew Adams References: <2CE5D98F-8F07-4E79-9132-FDBA0062D8E2@acm.org> <85v9wiex2a.fsf@gmail.com> <74D2BB46-AE27-4F7B-8E76-E12527834B53@acm.org> <85sgrlevdo.fsf@gmail.com> <9C8D8AE9-8B8B-4428-BC79-BEB82BC3E3A3@acm.org> In-Reply-To: <9C8D8AE9-8B8B-4428-BC79-BEB82BC3E3A3@acm.org> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=692 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907040203 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9307 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=759 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907040203 X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) FWIW: +1 for idiom `catch-throw' + `dolist' - clear to all Lispers. -1 for `cl-loop' here (unlispy language). 0 for `while' loop, `and' exit, and `setq' cdring (obfuscates a bit).