From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#58727: 29.0.50; rx doc: Semantics of RX... Date: Sun, 23 Oct 2022 04:32:17 +0200 Message-ID: <87tu3v2rta.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="665"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 58727@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 24 03:57:31 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ommiY-000Abi-F7 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 03:57:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omkEx-0007aQ-6G for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 Oct 2022 19:18:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omQnP-0005Ke-7J for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 22:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omQnO-000743-Uu for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 22:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omQnO-00088v-Dt for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 22:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Oct 2022 02:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58727 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166649234931256 (code B ref -1); Sun, 23 Oct 2022 02:33:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Oct 2022 02:32:29 +0000 Original-Received: from localhost ([127.0.0.1]:42692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omQmq-000884-Sq for submit@debbugs.gnu.org; Sat, 22 Oct 2022 22:32:29 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omQmm-00087u-EL for submit@debbugs.gnu.org; Sat, 22 Oct 2022 22:32:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omQmm-0005IW-65 for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 22:32:24 -0400 Original-Received: from mout.web.de ([212.227.15.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omQmi-0006zV-1M for bug-gnu-emacs@gnu.org; Sat, 22 Oct 2022 22:32:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1666492337; bh=r6gBLim2dbFhVgOVWdBJmTyHTJzEdDNvx5AtYdbCwkY=; h=X-UI-Sender-Class:From:To:Subject:Date; b=GJxLxI56GROgpN6eJ3sR071XyQ+bCq8+/X5s/4obuPJmfGy08p63bR/DP30LkYbw9 mCMt1jSLftKzAKXbvvpHn6jJPNmYE+PLYPwiuADXBc4FQZBTUbJA/fKsxDaAdFJ0uY HFDN0nZ7ZY80GojLd/bzbK7KRtkEyLGDwQlCkzG6/Fe9jUy4+EvYTM1/tCtk1hsbOr uxHS5RvGs9VKSZECGZ37cxdQPKLlcUfTmbisKBcGV7671vkq4rMB64RSBbJjEnD0Oh f+pumDeWdCJtxhDGorUZWB2KMI9uUhxVuvmSxkxNM4QtsxqDBrck6wBtqj0HcwCiav 5RsM9crm+3RgQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([188.105.185.54]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MQ8Wa-1oQWDB3B56-00MBdg; Sun, 23 Oct 2022 04:32:17 +0200 X-Provags-ID: V03:K1:nXm9M5LUoQ9PAdzi6QbPGXeA6Y8LM5r6gevVtpukdnq5OplJf5L q7+SFbsGr7Pu2eGqaOquW/sEBPi9hxbGiizptwOmRd6NLwvP7R1Sw8sezmCqltD24Re0ZMA H2wFx/NsN9ff2sZId5+G5oH9ZWrxNSujjAGBrlGv+NTXrjyUqsV7gZhPcRSsg3j/zpUqwiD Byt9E7zJdaMR83zy7Rplg== UI-OutboundReport: notjunk:1;M01:P0:jbm2G1ni24w=;oVsf5UdDWqWb7OmA1fYIYyN7Dlf 1kWq8RJKrfj6T/3xrZH2lWJLUCmFoDvFFGmwG7amBX9UMMdm0JgE5qV1guRuX7FsehGS6QCNk ozsNI1Ta/GMl3KH394rDzw/xVeVLsKNfUoo8R99IPXZT9Lgqka0JuGihGOUh0kwsrrPcElVd+ VqF9upE3mghJY8h8YC2AggKXs/OODoMR3AA5mXt3qN59eI7VZtiUPZ/Kkbi+9w03WZ4eqZk9e DP019C+A65JqhQaY3JZcMXAP0GqGGuM72ZIwCxsaSLMRb0vVqqCjF/VoZxoFy3mRz2mlQ0OcQ 7Bx4hgQIjInX5xxMBEwsEgIS2n04klZ90+0ThIGmYMlgKPxfowd6w7je/gnIouzmbVgwEgBGP RsQ1wKQspO/IBbGiMw8bvMahirO6jdo60ckGD0fczwwx3jR/reJggCZxZf5b2w4CHnUccugYr fxudDeRzPsDDgChnI+KyCvXL/oPAhP+szxLTWq1IYHrfkUL+T9kmUq8z/G5q18tOBbSdeY1ni sHQyovHvkKV6PI956dG8CDlJGKiDF/Sd2nkSpMaAw0eREEI8KV8Y87MwzyX1+2xbHlw38CmSe G7BGfvi+J/OcluOwE8bqOiJ7jo1EdFddQp7TjF8zKJ5NlhX4MwfydCluhh/Ve/U/gdWZsGV6N /QgxPOSCJ3o9c01i5n7+EuWNGj2AuCgyNrug5E2QmdTC8RF3OlDKNMwcosbg3hSb+wwtwkAoL nMKDkzlkN30LdTTaWVVxS78prNKxYye7DXUv3Gvl0QFKR+iSQ4n2Q4cTdMQ884GHApZVfIz1 Received-SPF: pass client-ip=212.227.15.3; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:246048 Archived-At: Hello, please document the semantics of multiple RXs for the RX repetition operators (and maybe grouping operators, too). The resulting regexps are concatenating like with an implicit `seq'. This is not trivial, though: in stringish regexps the repetition operators are only unary, and different interpretations would make sense for `rx' (implicit `seq', implicit `or'). The docstring of `rx' doesn't tell anything about this. The manual has sentences like | =E2=80=98(zero-or-more RX...)=E2=80=99 | =E2=80=98(0+ RX...)=E2=80=99 | Match the RXs zero or more times. Greedy by default. | Corresponding string regexp: =E2=80=98A*=E2=80=99 (greedy), =E2=80= =98A*?=E2=80=99 (non-greedy) but that suffers from the same problem that the semantics of A are not clear: A =3D=3D (seq RX...) ? Oh, and maybe let's also make more clear that `rx' always cares about implicit grouping when necessary. For example, in (info "(elisp) Rx Constructs") it's not trivial that e.g. in =E2=80=98(seq RX...)=E2=80=99 =E2=80=98(sequence RX...)=E2=80=99 =E2=80=98(: RX...)=E2=80=99 =E2=80=98(and RX...)=E2=80=99 Match the RXs in sequence. Without arguments, the expression matches the empty string. Corresponding string regexp: =E2=80=98AB...=E2=80=99 (subexpressions i= n sequence). `rx' silently adds shy grouping to the result, and the corresponding string regexp in this case is more precisely \(?:AB...\). I think it is enough to mention this implicit grouping feature once, but it is important to spell it out. =20=20 TIA, Michael.