X-Loop: owner@HIDDEN Subject: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' Reply-To: Jari Aalto <jari.aalto@HIDDEN>, 2816 <at> debbugs.gnu.org Resent-From: Jari Aalto <jari.aalto@HIDDEN> Resent-To: bug-submit-list@HIDDEN Resent-CC: Emacs Bugs <bug-gnu-emacs@HIDDEN> Resent-Date: Sun, 29 Mar 2009 15:35:04 +0000 Resent-Message-ID: <handler.2816.B.123834054915117@HIDDEN> Resent-Sender: help-debbugs@HIDDEN X-Emacs-PR-Message: report 2816 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@HIDDEN id=B.123834054915117 (code B ref -1); Sun, 29 Mar 2009 15:35:04 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 29 Mar 2009 15:29:09 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2TFT49H015111 for <submit@HIDDEN>; Sun, 29 Mar 2009 08:29:06 -0700 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 8ED40C7B0D for <submit@HIDDEN>; Sun, 29 Mar 2009 18:29:03 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A06861741C2; Sun, 29 Mar 2009 18:29:03 +0300 Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 831EE4035 for <submit@HIDDEN>; Sun, 29 Mar 2009 18:29:02 +0300 (EEST) Received: from [192.168.1.7] (helo=jondo.cante.net) by picasso.cante.net with esmtp (Exim 4.69) (envelope-from <jari.aalto@HIDDEN>) id 1LnwwT-0001LR-IK for submit@HIDDEN; Sun, 29 Mar 2009 18:28:57 +0300 Received: from jaalto by jondo.cante.net with local (Exim 4.69) (envelope-from <jari.aalto@HIDDEN>) id 1LnwwR-0004zE-7m for submit@HIDDEN; Sun, 29 Mar 2009 18:28:55 +0300 From: Jari Aalto <jari.aalto@HIDDEN> To: Emacs bug BTS <submit <at> debbugs.gnu.org> Date: Sun, 29 Mar 2009 18:28:55 +0300 Message-ID: <877i28nya0.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: 192.168.1.7 X-SA-Exim-Mail-From: jari.aalto@HIDDEN X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS A) (regexp-opt '("Abc" "abc")) => "\\(?:[Aa]bc\\)" B) (regexp-opt '("Abc" "def" "abc")) => "\\(?:Abc\\|abc\\|def\\)" Shouldn't regexp-opt optimize B case as well? Jari
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) Content-Type: text/plain; charset=utf-8 X-Loop: owner@HIDDEN From: help-debbugs@HIDDEN (Emacs bug Tracking System) To: Jari Aalto <jari.aalto@HIDDEN> Subject: bug#2816: Acknowledgement (regexp-opt: does not optimize 'Abc' and 'abc') Message-ID: <handler.2816.B.123834054915117.ack@HIDDEN> References: <877i28nya0.fsf@HIDDEN> X-Emacs-PR-Message: ack 2816 X-Emacs-PR-Package: emacs Reply-To: 2816 <at> debbugs.gnu.org Date: Sun, 29 Mar 2009 15:35:05 +0000 Thank you for filing a new bug report with Emacs. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Emacs Bugs <bug-gnu-emacs@HIDDEN> If you wish to submit further information on this problem, please send it to 2816 <at> debbugs.gnu.org, as before. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 2816: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2816 Emacs Bug Tracking System Contact help-debbugs@HIDDEN with problems
Received: (at control) by emacsbugs.donarmstrong.com; 29 Mar 2009 16:30:58 +0000 From jari.aalto@HIDDEN Sun Mar 29 09:30:58 2009 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=MURPHY_DRUGS_REL8, VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from emh07.mail.saunalahti.fi (emh07.mail.saunalahti.fi [62.142.5.117]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2TGUs7U031259 for <control@HIDDEN>; Sun, 29 Mar 2009 09:30:56 -0700 Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh07-2.mail.saunalahti.fi (Postfix) with SMTP id 8FDC518D24D for <control@HIDDEN>; Sun, 29 Mar 2009 19:30:53 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A078618CB0F; Sun, 29 Mar 2009 19:30:53 +0300 Received: from jondo.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 6ECAD4050 for <control@HIDDEN>; Sun, 29 Mar 2009 19:30:52 +0300 (EEST) From: Jari Aalto <jari.aalto@HIDDEN> To: control <at> debbugs.gnu.org Subject: Bug#2816 change of tags / patch Mail-Copies-To: poster X-Bug-User-Agent: Emacs 23.0.91.2 and tinydebian.el 2009.0307.1503 Date: Sun, 29 Mar 2009 19:30:51 +0300 Message-ID: <87skkwxpdw.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Antivirus: VAMS tags 2816 + patch thanks
X-Loop: owner@HIDDEN Subject: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' Reply-To: Stefan Monnier <monnier@HIDDEN>, 2816 <at> debbugs.gnu.org Resent-From: Stefan Monnier <monnier@HIDDEN> Resent-To: bug-submit-list@HIDDEN Resent-CC: Emacs Bugs <bug-gnu-emacs@HIDDEN> Resent-Date: Sun, 29 Mar 2009 17:20:03 +0000 Resent-Message-ID: <handler.2816.B.12383468059130@HIDDEN> Resent-Sender: help-debbugs@HIDDEN X-Emacs-PR-Message: followup 2816 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Received: via spool by submit@HIDDEN id=B.12383468059130 (code B ref -1); Sun, 29 Mar 2009 17:20:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 29 Mar 2009 17:13:25 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2THDFE7009118; Sun, 29 Mar 2009 10:13:17 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMFAHNJz0lFxIfy/2dsb2JhbACBUcYdg3oGhHc X-IronPort-AV: E=Sophos;i="4.38,442,1233550800"; d="scan'208";a="35897495" Received: from 69-196-135-242.dsl.teksavvy.com (HELO pastel.home) ([69.196.135.242]) by ironport2-out.teksavvy.com with ESMTP; 29 Mar 2009 13:13:10 -0400 Received: by pastel.home (Postfix, from userid 20848) id 7111C8682; Sun, 29 Mar 2009 13:13:09 -0400 (EDT) From: Stefan Monnier <monnier@HIDDEN> To: Jari Aalto <jari.aalto@HIDDEN> Cc: 2816 <at> debbugs.gnu.org, Emacs bug BTS <submit <at> debbugs.gnu.org> Message-ID: <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> References: <877i28nya0.fsf@HIDDEN> Date: Sun, 29 Mar 2009 13:13:09 -0400 In-Reply-To: <877i28nya0.fsf@HIDDEN> (Jari Aalto's message of "Sun, 29 Mar 2009 18:28:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-CrossAssassin-Score: 2 > A) > (regexp-opt > '("Abc" > "abc")) > => "\\(?:[Aa]bc\\)" > B) > (regexp-opt > '("Abc" > "def" > "abc")) > => "\\(?:Abc\\|abc\\|def\\)" > Shouldn't regexp-opt optimize B case as well? The `opt' of regexp-opt should be understood in the sense of optimization used in compilers, not in the formal mathematical sense of "optimal". I.e. it does some effort to improve things, but without any guarantee about what is and what isn't optimized. So, yes, it would be good if it did do what you suggest, but it's not a bug if it doesn't. Stefan
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) Content-Type: text/plain; charset=utf-8 X-Loop: owner@HIDDEN From: help-debbugs@HIDDEN (Emacs bug Tracking System) To: Stefan Monnier <monnier@HIDDEN> Subject: bug#2816: Info received (bug#2816: regexp-opt: does not optimize 'Abc' and 'abc') Message-ID: <handler.2816.B.12383468059130.ackinfo@HIDDEN> References: <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> X-Emacs-PR-Message: ack-info 2816 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Reply-To: 2816 <at> debbugs.gnu.org Date: Sun, 29 Mar 2009 17:20:03 +0000 Thank you for the additional information you have supplied regarding this bug report. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Emacs Bugs <bug-gnu-emacs@HIDDEN> If you wish to submit further information on this problem, please send it to 2816 <at> debbugs.gnu.org, as before. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 2816: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2816 Emacs Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: owner@HIDDEN Subject: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' Reply-To: Stefan Monnier <monnier@HIDDEN>, 2816 <at> debbugs.gnu.org Resent-From: Stefan Monnier <monnier@HIDDEN> Resent-To: bug-submit-list@HIDDEN Resent-CC: Emacs Bugs <bug-gnu-emacs@HIDDEN> Resent-Date: Sun, 29 Mar 2009 17:20:05 +0000 Resent-Message-ID: <handler.2816.B2816.12383468059128@HIDDEN> Resent-Sender: help-debbugs@HIDDEN X-Emacs-PR-Message: followup 2816 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Received: via spool by 2816-submit@HIDDEN id=B2816.12383468059128 (code B ref 2816); Sun, 29 Mar 2009 17:20:05 +0000 Received: (at 2816) by emacsbugs.donarmstrong.com; 29 Mar 2009 17:13:25 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2THDFE7009118; Sun, 29 Mar 2009 10:13:17 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMFAHNJz0lFxIfy/2dsb2JhbACBUcYdg3oGhHc X-IronPort-AV: E=Sophos;i="4.38,442,1233550800"; d="scan'208";a="35897495" Received: from 69-196-135-242.dsl.teksavvy.com (HELO pastel.home) ([69.196.135.242]) by ironport2-out.teksavvy.com with ESMTP; 29 Mar 2009 13:13:10 -0400 Received: by pastel.home (Postfix, from userid 20848) id 7111C8682; Sun, 29 Mar 2009 13:13:09 -0400 (EDT) From: Stefan Monnier <monnier@HIDDEN> To: Jari Aalto <jari.aalto@HIDDEN> Cc: 2816 <at> debbugs.gnu.org, Emacs bug BTS <submit <at> debbugs.gnu.org> Message-ID: <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> References: <877i28nya0.fsf@HIDDEN> Date: Sun, 29 Mar 2009 13:13:09 -0400 In-Reply-To: <877i28nya0.fsf@HIDDEN> (Jari Aalto's message of "Sun, 29 Mar 2009 18:28:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > A) > (regexp-opt > '("Abc" > "abc")) > => "\\(?:[Aa]bc\\)" > B) > (regexp-opt > '("Abc" > "def" > "abc")) > => "\\(?:Abc\\|abc\\|def\\)" > Shouldn't regexp-opt optimize B case as well? The `opt' of regexp-opt should be understood in the sense of optimization used in compilers, not in the formal mathematical sense of "optimal". I.e. it does some effort to improve things, but without any guarantee about what is and what isn't optimized. So, yes, it would be good if it did do what you suggest, but it's not a bug if it doesn't. Stefan
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) Content-Type: text/plain; charset=utf-8 X-Loop: owner@HIDDEN From: help-debbugs@HIDDEN (Emacs bug Tracking System) To: Stefan Monnier <monnier@HIDDEN> Subject: bug#2816: Info received (bug#2816: regexp-opt: does not optimize 'Abc' and 'abc') Message-ID: <handler.2816.B2816.12383468059128.ackinfo@HIDDEN> References: <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> X-Emacs-PR-Message: ack-info 2816 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: patch Reply-To: 2816 <at> debbugs.gnu.org Date: Sun, 29 Mar 2009 17:20:05 +0000 Thank you for the additional information you have supplied regarding this bug report. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Emacs Bugs <bug-gnu-emacs@HIDDEN> If you wish to submit further information on this problem, please send it to 2816 <at> debbugs.gnu.org, as before. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 2816: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2816 Emacs Bug Tracking System Contact help-debbugs@HIDDEN with problems
Received: (at control) by emacsbugs.donarmstrong.com; 29 Mar 2009 20:42:38 +0000 From jari.aalto@HIDDEN Sun Mar 29 13:42:37 2009 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from emh05.mail.saunalahti.fi (emh05.mail.saunalahti.fi [62.142.5.111]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2TKgYKH029108 for <control@HIDDEN>; Sun, 29 Mar 2009 13:42:35 -0700 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh05-2.mail.saunalahti.fi (Postfix) with SMTP id 1F1C08BBB7 for <control@HIDDEN>; Sun, 29 Mar 2009 23:42:33 +0300 (EEST) Received: from emh04.mail.saunalahti.fi ([62.142.5.110]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A06E57007F9; Sun, 29 Mar 2009 23:42:33 +0300 Received: from jondo.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh04.mail.saunalahti.fi (Postfix) with ESMTP id 098D041BE8 for <control@HIDDEN>; Sun, 29 Mar 2009 23:42:31 +0300 (EEST) From: Jari Aalto <jari.aalto@HIDDEN> To: control <at> debbugs.gnu.org Subject: Bug#2816 Change of severity / wishlist Mail-Copies-To: poster X-Bug-User-Agent: Emacs 23.0.91.2 and tinydebian.el 2009.0307.1503 Date: Sun, 29 Mar 2009 23:42:31 +0300 Message-ID: <87bprkxdqg.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Antivirus: VAMS severity 2816 wishlist thanks
Received: (at control) by emacsbugs.donarmstrong.com; 7 Apr 2009 02:32:22 +0000 From rgm@HIDDEN Mon Apr 6 19:32:22 2009 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n372WJeX004942 for <control@HIDDEN>; Mon, 6 Apr 2009 19:32:21 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from <rgm@HIDDEN>) id 1Lr16p-0001TO-1U; Mon, 06 Apr 2009 22:32:19 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18906.47922.961917.469812@HIDDEN> Date: Mon, 6 Apr 2009 22:32:18 -0400 From: Glenn Morris <rgm@HIDDEN> To: control <control <at> debbugs.gnu.org> Subject: control message merge 2879 2880 2882 2883 reassign 2879 notemacs tags 2816 - patch merge 2912 2913
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Stefan Kangas <stefankangas@HIDDEN> Subject: bug#2816: closed (regexp-opt: does not optimize 'Abc' and 'abc') CC: tracker <at> debbugs.gnu.org Message-ID: <handler.2816.D2816.174171148514615.ackdone <at> debbugs.gnu.org> References: <CADwFkm=pQCeEStU-VgsseMXi8+FRaBczVHMfGeh5tZtQ7O5VFQ@HIDDEN> <877i28nya0.fsf@HIDDEN> X-Gnu-PR-Message: closed 2816 X-Gnu-PR-Package: emacs Date: Tue, 11 Mar 2025 16:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1741711502-14655-0" This is a multi-part message in MIME format... ------------=_1741711502-14655-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Tue, 11 Mar 2025 09:44:31 -0700 with message-id <CADwFkm=3DpQCeEStU-VgsseMXi8+FRaBczVHMfGeh5tZtQ7O5VFQ@mail= .gmail.com> and subject line Re: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' has caused the debbugs.gnu.org bug report #2816, regarding regexp-opt: does not optimize 'Abc' and 'abc' to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@HIDDEN) --=20 2816: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2816 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1741711502-14655-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 29 Mar 2009 15:29:09 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2TFT49H015111 for <submit@HIDDEN>; Sun, 29 Mar 2009 08:29:06 -0700 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 8ED40C7B0D for <submit@HIDDEN>; Sun, 29 Mar 2009 18:29:03 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A06861741C2; Sun, 29 Mar 2009 18:29:03 +0300 Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 831EE4035 for <submit@HIDDEN>; Sun, 29 Mar 2009 18:29:02 +0300 (EEST) Received: from [192.168.1.7] (helo=jondo.cante.net) by picasso.cante.net with esmtp (Exim 4.69) (envelope-from <jari.aalto@HIDDEN>) id 1LnwwT-0001LR-IK for submit@HIDDEN; Sun, 29 Mar 2009 18:28:57 +0300 Received: from jaalto by jondo.cante.net with local (Exim 4.69) (envelope-from <jari.aalto@HIDDEN>) id 1LnwwR-0004zE-7m for submit@HIDDEN; Sun, 29 Mar 2009 18:28:55 +0300 From: Jari Aalto <jari.aalto@HIDDEN> To: Emacs bug BTS <submit <at> debbugs.gnu.org> Subject: regexp-opt: does not optimize 'Abc' and 'abc' Date: Sun, 29 Mar 2009 18:28:55 +0300 Message-ID: <877i28nya0.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: 192.168.1.7 X-SA-Exim-Mail-From: jari.aalto@HIDDEN X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS A) (regexp-opt '("Abc" "abc")) => "\\(?:[Aa]bc\\)" B) (regexp-opt '("Abc" "def" "abc")) => "\\(?:Abc\\|abc\\|def\\)" Shouldn't regexp-opt optimize B case as well? Jari ------------=_1741711502-14655-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2816-close) by debbugs.gnu.org; 11 Mar 2025 16:44:45 +0000 Received: from localhost ([127.0.0.1]:45259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ts2ii-0003nd-Ft for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 12:44:44 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:48421) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1ts2ie-0003nI-2e for 2816-close <at> debbugs.gnu.org; Tue, 11 Mar 2025 12:44:41 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5e5e34f4e89so8736449a12.1 for <2816-close <at> debbugs.gnu.org>; Tue, 11 Mar 2025 09:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741711473; x=1742316273; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=kAz+AGUj5iB4lEgDt0GGbqv8kNnKpvYX8K4qkKqtkx0=; b=dSNjMpw1V7eEzxvmwdltwZHGopqdHDZNy5V+Cg7JNUw3P0+Ku6ygOS4TDic4I9IeVB 9FRqUOuR+YZP+Jz/dftzUdJNmrENXSjRawXDku4Tvtc9TvzMsLhkDfGWeZ4VpmTr/i+b nVSc4nrW1XRBvUEpoeAQb0xNC8D1eVEUn6y/8oEVkp3bph+nl9f39raU1wetWVVN6Z+X Y9OPFtT3y+xvFCsghIrMth5Tse7Omt0iX915nhsgXVLC1lLuhw3CzXgMg+auvHcUs82Y qibcaTNkA8pDKBrKq/tgE8RVugLZ/C8ZpnXG8dWEhuhvO5mP0AvOptdnr6+c0Yj++K4/ SjuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741711473; x=1742316273; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kAz+AGUj5iB4lEgDt0GGbqv8kNnKpvYX8K4qkKqtkx0=; b=Za5+EDUGmATzLleLm7W8G3JvCbmd0mpr1Oj0gpg/czXxCufEHVnNhfWRmySuK0fWad aZWmWU/okonRgmt50BvYpNMEGr537ladbGx83RjzAzz4ZaNZOmaKbV26kVneK6GkqkAe n7O7nUOcILVKKZRMaq0dOlFPZH4i9oQG4zIRnM3Lh/lVUkgbaUm8As7bFDyA71jGF9tO XlB7UgoG3ZlGWpgQ42ornTvoad138SX73r8CAOMdt/8vpPGTouv9xwxuCAFL6dep08RM ghJ36h6s0TiTpmzFD1GUBqQbvYHnmD7oP40f9UrhzY2aUeVUTMkdUetVj2hMmC+2PHUl endA== X-Forwarded-Encrypted: i=1; AJvYcCWnZ47MCjiAO5IjepF4+QEhNLpGU42BFbHcNhvW/glxJsPZPkIwVdCooNCbT3RT5tWLWdUS2YgFroj7 <at> debbugs.gnu.org X-Gm-Message-State: AOJu0Yz3/xNOcvoS+IsK7aaiWoZqUt24l1+yHtkmiZX5kAnFm1TYPu6V sdOMLxO+uUCfgdz1VPu7lyr4NQNr8C+qsnDuKANVqnvfV/KZBxdqgwZzze7UT5P6HK/dVkJXOTk UBSdmZnKm1KskirrGg6c5jy6FhlE= X-Gm-Gg: ASbGncsTtC+nmEbhtvCmHgq8hnsrxhxvKkwYnrvQoxoGfgJz1ESModKUrzG3inpbX7B cYucvE/ZWoq2cdQ3c40SQVHryPzSgFkg/w3BYN0UWVFX0hNNT8UNJHQVxQk53AyME3ufIT7hGS+ 9lAu2xsewHbbLRSoNvH4BoyuBbbQ== X-Google-Smtp-Source: AGHT+IHKFC6OdYtXHjHDEL1TM6F476bq9BIgHbOzgQ6D3OZ3FV17q2k9BT2mZOCg8fLJTkYitchoq12bG49Rot/2lgc= X-Received: by 2002:a05:6402:254c:b0:5e0:8937:6ef2 with SMTP id 4fb4d7f45d1cf-5e5e22bf4b1mr17871003a12.8.1741711472598; Tue, 11 Mar 2025 09:44:32 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Mar 2025 09:44:31 -0700 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> References: <877i28nya0.fsf@HIDDEN> <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> MIME-Version: 1.0 Date: Tue, 11 Mar 2025 09:44:31 -0700 X-Gm-Features: AQ5f1JrC4UzY6lsSeGzREFHwAyHi8_hlYlbMsH6Nvk_DjygVIW1zc3h8FSMa_4c Message-ID: <CADwFkm=pQCeEStU-VgsseMXi8+FRaBczVHMfGeh5tZtQ7O5VFQ@HIDDEN> Subject: Re: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' To: Stefan Monnier <monnier@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 2816-close Cc: 2816-close <at> debbugs.gnu.org, Jari Aalto <jari.aalto@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Monnier <monnier@HIDDEN> writes: >> A) > >> (regexp-opt >> '("Abc" >> "abc")) > >> => "\\(?:[Aa]bc\\)" > >> B) > >> (regexp-opt >> '("Abc" >> "def" >> "abc")) > >> => "\\(?:Abc\\|abc\\|def\\)" > >> Shouldn't regexp-opt optimize B case as well? > > The `opt' of regexp-opt should be understood in the sense of > optimization used in compilers, not in the formal mathematical sense of > "optimal". I.e. it does some effort to improve things, but without any > guarantee about what is and what isn't optimized. > > So, yes, it would be good if it did do what you suggest, but it's not > a bug if it doesn't. Without a proposed patch, I think it's unlikely that we'll make much progress here. After 16 years, I'm closing this bug now. If anyone wants to propose improvements to `regexp-opt`, please open a new bug report. ------------=_1741711502-14655-0--
MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Jari Aalto <jari.aalto@HIDDEN> Subject: bug#2816: closed (Re: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc') Message-ID: <handler.2816.D2816.174171148514615.notifdone <at> debbugs.gnu.org> References: <CADwFkm=pQCeEStU-VgsseMXi8+FRaBczVHMfGeh5tZtQ7O5VFQ@HIDDEN> <877i28nya0.fsf@HIDDEN> X-Gnu-PR-Message: they-closed 2816 X-Gnu-PR-Package: emacs Reply-To: 2816 <at> debbugs.gnu.org Date: Tue, 11 Mar 2025 16:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1741711502-14655-1" This is a multi-part message in MIME format... ------------=_1741711502-14655-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #2816: regexp-opt: does not optimize 'Abc' and 'abc' 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 2816 <at> debbugs.gnu.org. --=20 2816: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D2816 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems ------------=_1741711502-14655-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 2816-close) by debbugs.gnu.org; 11 Mar 2025 16:44:45 +0000 Received: from localhost ([127.0.0.1]:45259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ts2ii-0003nd-Ft for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 12:44:44 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:48421) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1ts2ie-0003nI-2e for 2816-close <at> debbugs.gnu.org; Tue, 11 Mar 2025 12:44:41 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5e5e34f4e89so8736449a12.1 for <2816-close <at> debbugs.gnu.org>; Tue, 11 Mar 2025 09:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741711473; x=1742316273; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=kAz+AGUj5iB4lEgDt0GGbqv8kNnKpvYX8K4qkKqtkx0=; b=dSNjMpw1V7eEzxvmwdltwZHGopqdHDZNy5V+Cg7JNUw3P0+Ku6ygOS4TDic4I9IeVB 9FRqUOuR+YZP+Jz/dftzUdJNmrENXSjRawXDku4Tvtc9TvzMsLhkDfGWeZ4VpmTr/i+b nVSc4nrW1XRBvUEpoeAQb0xNC8D1eVEUn6y/8oEVkp3bph+nl9f39raU1wetWVVN6Z+X Y9OPFtT3y+xvFCsghIrMth5Tse7Omt0iX915nhsgXVLC1lLuhw3CzXgMg+auvHcUs82Y qibcaTNkA8pDKBrKq/tgE8RVugLZ/C8ZpnXG8dWEhuhvO5mP0AvOptdnr6+c0Yj++K4/ SjuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741711473; x=1742316273; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kAz+AGUj5iB4lEgDt0GGbqv8kNnKpvYX8K4qkKqtkx0=; b=Za5+EDUGmATzLleLm7W8G3JvCbmd0mpr1Oj0gpg/czXxCufEHVnNhfWRmySuK0fWad aZWmWU/okonRgmt50BvYpNMEGr537ladbGx83RjzAzz4ZaNZOmaKbV26kVneK6GkqkAe n7O7nUOcILVKKZRMaq0dOlFPZH4i9oQG4zIRnM3Lh/lVUkgbaUm8As7bFDyA71jGF9tO XlB7UgoG3ZlGWpgQ42ornTvoad138SX73r8CAOMdt/8vpPGTouv9xwxuCAFL6dep08RM ghJ36h6s0TiTpmzFD1GUBqQbvYHnmD7oP40f9UrhzY2aUeVUTMkdUetVj2hMmC+2PHUl endA== X-Forwarded-Encrypted: i=1; AJvYcCWnZ47MCjiAO5IjepF4+QEhNLpGU42BFbHcNhvW/glxJsPZPkIwVdCooNCbT3RT5tWLWdUS2YgFroj7 <at> debbugs.gnu.org X-Gm-Message-State: AOJu0Yz3/xNOcvoS+IsK7aaiWoZqUt24l1+yHtkmiZX5kAnFm1TYPu6V sdOMLxO+uUCfgdz1VPu7lyr4NQNr8C+qsnDuKANVqnvfV/KZBxdqgwZzze7UT5P6HK/dVkJXOTk UBSdmZnKm1KskirrGg6c5jy6FhlE= X-Gm-Gg: ASbGncsTtC+nmEbhtvCmHgq8hnsrxhxvKkwYnrvQoxoGfgJz1ESModKUrzG3inpbX7B cYucvE/ZWoq2cdQ3c40SQVHryPzSgFkg/w3BYN0UWVFX0hNNT8UNJHQVxQk53AyME3ufIT7hGS+ 9lAu2xsewHbbLRSoNvH4BoyuBbbQ== X-Google-Smtp-Source: AGHT+IHKFC6OdYtXHjHDEL1TM6F476bq9BIgHbOzgQ6D3OZ3FV17q2k9BT2mZOCg8fLJTkYitchoq12bG49Rot/2lgc= X-Received: by 2002:a05:6402:254c:b0:5e0:8937:6ef2 with SMTP id 4fb4d7f45d1cf-5e5e22bf4b1mr17871003a12.8.1741711472598; Tue, 11 Mar 2025 09:44:32 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Mar 2025 09:44:31 -0700 From: Stefan Kangas <stefankangas@HIDDEN> In-Reply-To: <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> References: <877i28nya0.fsf@HIDDEN> <jwvy6uo9rwy.fsf-monnier+emacsbugreports@HIDDEN> MIME-Version: 1.0 Date: Tue, 11 Mar 2025 09:44:31 -0700 X-Gm-Features: AQ5f1JrC4UzY6lsSeGzREFHwAyHi8_hlYlbMsH6Nvk_DjygVIW1zc3h8FSMa_4c Message-ID: <CADwFkm=pQCeEStU-VgsseMXi8+FRaBczVHMfGeh5tZtQ7O5VFQ@HIDDEN> Subject: Re: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' To: Stefan Monnier <monnier@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 2816-close Cc: 2816-close <at> debbugs.gnu.org, Jari Aalto <jari.aalto@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Monnier <monnier@HIDDEN> writes: >> A) > >> (regexp-opt >> '("Abc" >> "abc")) > >> => "\\(?:[Aa]bc\\)" > >> B) > >> (regexp-opt >> '("Abc" >> "def" >> "abc")) > >> => "\\(?:Abc\\|abc\\|def\\)" > >> Shouldn't regexp-opt optimize B case as well? > > The `opt' of regexp-opt should be understood in the sense of > optimization used in compilers, not in the formal mathematical sense of > "optimal". I.e. it does some effort to improve things, but without any > guarantee about what is and what isn't optimized. > > So, yes, it would be good if it did do what you suggest, but it's not > a bug if it doesn't. Without a proposed patch, I think it's unlikely that we'll make much progress here. After 16 years, I'm closing this bug now. If anyone wants to propose improvements to `regexp-opt`, please open a new bug report. ------------=_1741711502-14655-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 29 Mar 2009 15:29:09 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from emh06.mail.saunalahti.fi (emh06.mail.saunalahti.fi [62.142.5.116]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2TFT49H015111 for <submit@HIDDEN>; Sun, 29 Mar 2009 08:29:06 -0700 Received: from saunalahti-vams (vs3-12.mail.saunalahti.fi [62.142.5.96]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 8ED40C7B0D for <submit@HIDDEN>; Sun, 29 Mar 2009 18:29:03 +0300 (EEST) Received: from emh01.mail.saunalahti.fi ([62.142.5.107]) by vs3-12.mail.saunalahti.fi ([62.142.5.96]) with SMTP (gateway) id A06861741C2; Sun, 29 Mar 2009 18:29:03 +0300 Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh01.mail.saunalahti.fi (Postfix) with ESMTP id 831EE4035 for <submit@HIDDEN>; Sun, 29 Mar 2009 18:29:02 +0300 (EEST) Received: from [192.168.1.7] (helo=jondo.cante.net) by picasso.cante.net with esmtp (Exim 4.69) (envelope-from <jari.aalto@HIDDEN>) id 1LnwwT-0001LR-IK for submit@HIDDEN; Sun, 29 Mar 2009 18:28:57 +0300 Received: from jaalto by jondo.cante.net with local (Exim 4.69) (envelope-from <jari.aalto@HIDDEN>) id 1LnwwR-0004zE-7m for submit@HIDDEN; Sun, 29 Mar 2009 18:28:55 +0300 From: Jari Aalto <jari.aalto@HIDDEN> To: Emacs bug BTS <submit <at> debbugs.gnu.org> Subject: regexp-opt: does not optimize 'Abc' and 'abc' Date: Sun, 29 Mar 2009 18:28:55 +0300 Message-ID: <877i28nya0.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: 192.168.1.7 X-SA-Exim-Mail-From: jari.aalto@HIDDEN X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS A) (regexp-opt '("Abc" "abc")) => "\\(?:[Aa]bc\\)" B) (regexp-opt '("Abc" "def" "abc")) => "\\(?:Abc\\|abc\\|def\\)" Shouldn't regexp-opt optimize B case as well? Jari ------------=_1741711502-14655-1--
X-Loop: help-debbugs@HIDDEN Subject: bug#2816: regexp-opt: does not optimize 'Abc' and 'abc'. References: <877i28nya0.fsf@HIDDEN> In-Reply-To: <877i28nya0.fsf@HIDDEN> Resent-From: Stefan Kangas <stefankangas@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 11 Mar 2025 16:47:02 +0000 Resent-Message-ID: <handler.2816.D2816.174171158315214 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 2816 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier <monnier@HIDDEN> Cc: 2816-close <at> debbugs.gnu.org, Jari Aalto <jari.aalto@HIDDEN> Received: via spool by 2816-done <at> debbugs.gnu.org id=D2816.174171158315214 (code D ref 2816); Tue, 11 Mar 2025 16:47:02 +0000 Received: (at 2816-close) by debbugs.gnu.org; 11 Mar 2025 16:46:23 +0000 Received: from localhost ([127.0.0.1]:45272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ts2kI-0003xK-JY for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 12:46:22 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:59726) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1ts2kE-0003wq-En for 2816-close <at> debbugs.gnu.org; Tue, 11 Mar 2025 12:46:19 -0400 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5e5c7d6b96fso9375294a12.3 for <2816-close <at> debbugs.gnu.org>; Tue, 11 Mar 2025 09:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741711572; x=1742316372; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=kAz+AGUj5iB4lEgDt0GGbqv8kNnKpvYX8K4qkKqtkx0=; b=cym+PqpoZQzuaSqk1tCrtcog9uHHNDHM12frTRRHlw6HZuIxm6f9HdptXKJ7DXSqbz J3tSMvhXBF3cuo9Q18lQDmYzyhSovNkjYDjMP07OI3/CIgAcsTX8e8Z8OdKGQAFSWqzR fur9Rck4JcFFn4K+Npa8X3v6rOyXdqZS8fZ0xD3RTs+v7wuV07zH3ULLuWLw5ZDrrs8X uoaXOEX2gJMdDCmhUlFdnkd6GoVw93QFC/zEiC3TN1XjyRAXIbMxabrRpWIbo8nZW3Se Ums+Rvra/usg9EELacsBQf14uVY9/jLfZlnexy8L2yo3Czgcx7wxkIUU0UpbAuCzCoHP 8DdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741711572; x=1742316372; h=cc:to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kAz+AGUj5iB4lEgDt0GGbqv8kNnKpvYX8K4qkKqtkx0=; b=p7uTXLTNCl8H13zaWsBCfARYchHg9fQFQCpZOZ2Q4bhMw3Rz4b5l2Km3vitp79ssCc KpWl+nd7xZ2edVKr/L7ymzzc2cM0FLJSGkVUJS+sxtkh7PCnzLdA2A/gp/D+gpWMzShF AHeyS5QDhc8z+CfmRrt7uvepbHjaouB+E7ff9IDs/s+/HhrksZ6nEeVLz3Q1I2RHZDRp 49YkSF+yEcgYVXCXv3k2vp0l0dIe7T1Ugbpi2GX43fqciGL5fiWUUugz5tYFjvcVg5xN ++03ync+ZPUfZNmkFqpNjzreUJudKd1E1nQlvJelDXGaMCUpv+RPsM8Y6g3MlRmfacPk 2SIw== X-Forwarded-Encrypted: i=1; AJvYcCUv5/1lA9sWxbRLPuKPermtjA9pG6HQUrBBSGM7d0GjlFp46Ppd7sGQoccRm0uc6xYw5NS8NCzHqEgD <at> debbugs.gnu.org X-Gm-Message-State: AOJu0YxKpGKwymihe0fHBFFMq+oxg/kJsZljyDsH4vNGHafAVjbZzuLm ibg+FgV8vmiC7NkuezAlBdwoY7JEZDdlIzocDh2Kndq+iL4g164/87sQ4OLpnwAPGZEt9BOXnLU UBmP2MNLEreyvc5ZNSh3GjpG0BrE= X-Gm-Gg: ASbGncvgv106MdUhBtrar3flvSOgHVXUNV1lcNMVdnT9kwdMpnFne4RPoR8nvBqUROO twQfKYx5diKnhPr5Nk8c4oCZcJaZF14myvddCJ78vcHcX0G66EDV4fQa4y5U8w8V4N81SCTyb+n JJDgDtzr5y3ZEwglw+IslbOFSnsQ== X-Google-Smtp-Source: AGHT+IHT/iBIT5GxoNiWqFOygQahuz0E86mK60S1ApGMIS+6cbjrpYPzlQ1cWz2bZbk9fMHPyQYWREY4F8RmyVyfCR0= X-Received: by 2002:a05:6402:1912:b0:5e5:bdfe:6bfb with SMTP id 4fb4d7f45d1cf-5e5e2319be8mr21795867a12.16.1741711571814; Tue, 11 Mar 2025 09:46:11 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Mar 2025 09:46:10 -0700 From: Stefan Kangas <stefankangas@HIDDEN> MIME-Version: 1.0 Date: Tue, 11 Mar 2025 09:46:10 -0700 X-Gm-Features: AQ5f1JqBIcOj-0GE5rrZbpwr1qve_S0ieaVk-3VWaVDVuOz1VTt1Dy1uDkus6dQ Message-ID: <CADwFkmmD2mcnHT3YraK0ncqvOngZrCGoZEvXi_r=rfr4eF3gXg@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Stefan Monnier <monnier@HIDDEN> writes: >> A) > >> (regexp-opt >> '("Abc" >> "abc")) > >> => "\\(?:[Aa]bc\\)" > >> B) > >> (regexp-opt >> '("Abc" >> "def" >> "abc")) > >> => "\\(?:Abc\\|abc\\|def\\)" > >> Shouldn't regexp-opt optimize B case as well? > > The `opt' of regexp-opt should be understood in the sense of > optimization used in compilers, not in the formal mathematical sense of > "optimal". I.e. it does some effort to improve things, but without any > guarantee about what is and what isn't optimized. > > So, yes, it would be good if it did do what you suggest, but it's not > a bug if it doesn't. Without a proposed patch, I think it's unlikely that we'll make much progress here. After 16 years, I'm closing this bug now. If anyone wants to propose improvements to `regexp-opt`, please open a new bug report.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.