From unknown Mon Jun 23 13:09:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#29343 <29343@debbugs.gnu.org> To: bug#29343 <29343@debbugs.gnu.org> Subject: Status: Match data doesn't contain elements for trailing non-matched subgroups Reply-To: bug#29343 <29343@debbugs.gnu.org> Date: Mon, 23 Jun 2025 20:09:56 +0000 retitle 29343 Match data doesn't contain elements for trailing non-matched = subgroups reassign 29343 emacs submitter 29343 Philipp Stephani severity 29343 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 17 15:11:27 2017 Received: (at submit) by debbugs.gnu.org; 17 Nov 2017 20:11:27 +0000 Received: from localhost ([127.0.0.1]:45323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFmz0-0001u3-TY for submit@debbugs.gnu.org; Fri, 17 Nov 2017 15:11:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFmyz-0001tq-QF for submit@debbugs.gnu.org; Fri, 17 Nov 2017 15:11:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFmyt-0003Ld-Cw for submit@debbugs.gnu.org; Fri, 17 Nov 2017 15:11:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFmyt-0003LX-8a for submit@debbugs.gnu.org; Fri, 17 Nov 2017 15:11:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFmyr-0003Af-Um for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 15:11:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFmyq-0003J2-Qh for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 15:11:17 -0500 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:37678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFmyq-0003Hl-IN for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 15:11:16 -0500 Received: by mail-wr0-x22c.google.com with SMTP id k61so3063787wrc.4 for ; Fri, 17 Nov 2017 12:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=74NrpUz4gCwja7UUGMNtKXnJ2m5KLHJJT8qQSUCf+4Y=; b=J+2KVgmm2w9ucICQH6HaA2aXGdKNoEmVi4JCdJCVPaA7d3EUlstP0nWTun2LCZJIc0 szVyFMq2K2bxRoDegzufWTd3wjZtrIyddSi9eeGr96XqWRFPNClSkDBFzEzEKknIrTde xWb/3zE4GrU8oGzKtOMIV4RGNUvfS5Vnu/ZB7h7418UUcra8j38IZF5YSzQt42SSpF7W /aj0QRudXldlgjYnWngcSc6lN3Zy2tq1+R7sfwWwq/TtVDBw6uu44boXq52HPWTJX7vu tfjD6u+R7/9lIVROmYKychVCRmAPQ6fLLuZWWtbKa3h3inidh37RDVT7kZ3qMFaclBo+ 1jBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=74NrpUz4gCwja7UUGMNtKXnJ2m5KLHJJT8qQSUCf+4Y=; b=H9c/u5VimtG5MZk3VFdHvEV+yeGrAYFsHQzHFEKVRcJNTVIBGLisidqZpOPfZNdv8T Bu+rTqHWmhvz50r8Jrhql7gb2sIYh1r6FwAiTttmGx+090tHXrZkHuLHgWjNkv8ntqfS 4N3FbzmA0hr1DCuCoH6PHiVk3/61af/z2RXJYSL74ZfA/DkmPs3A5DGCbXReZFCk2Vzv xGSUhGlav6UOZFAsW5aghF1yzJsJ03lxjmd12VY9YjZfHtSr3VdVJEln4qKDsSuaRz71 +4TEpJPbqepktLwBrXX8NnvJ1SeuMRmimYnJ2dzPBxGDhPoyJk9ZV+UDAt+4/RrcbXAZ flAg== X-Gm-Message-State: AJaThX4eAZ8tc7SIJTOUlJDa94nL7vFbsxAPg1lM5/tSC1KTqhi4p6KL TOJNw0u7d7xjKjqSRjBT8GaxIJm6 X-Google-Smtp-Source: AGs4zMYmVAB15nNBCrpXlh5s3Cc1SMfmM9AD2H24qilD/LSC5iQGdwijL2XvEEmBEPlNWKntJpqZTg== X-Received: by 10.223.165.67 with SMTP id j3mr5677086wrb.181.1510949475037; Fri, 17 Nov 2017 12:11:15 -0800 (PST) Received: from a.muc.corp.google.com ([2a00:79e0:15:4:bfda:710c:4a38:a674]) by smtp.gmail.com with ESMTPSA id p42sm6918884wrb.28.2017.11.17.12.11.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 12:11:14 -0800 (PST) From: Philipp Stephani To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Match data doesn't contain elements for non-matched subgroups Date: Fri, 17 Nov 2017 21:11:13 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) 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: -3.8 (---) $ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(c\\)?$" "= b") (print (match-data)))' (0 1 nil nil 0 1) Note that neither the `a` nor the `c` group matched, but there are entries for `a` in `match-data`, but not for `c`. This makes working with the match data unnecessarily hard because its length depends on whether certain optional groups have matched or not. I haven't seen any discussion about this behavior in either the manual or the docstring. I think the match data in this case should be (0 1 nil nil 0 1 nil nil). In GNU Emacs 27.0.50 (build 12, x86_64-pc-linux-gnu, GTK+ Version 3.22.17) of 2017-11-16 built on localhost Repository revision: bc462efec89c3317a6ee3ef9404356c1c7e52bda Windowing system distributor 'The X.Org Foundation', version 11.0.11903000 System Description: Debian GNU/Linux Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --enable-gcc-warnings=3Dwarn-only --enable-gtk-deprecation-warnings --without-pop --with-mailutils --enable-checking --enable-check-lisp-object-type --with-modules 'CFLAGS=3D-O0 -ggdb3'' Configured features: XPM JPEG TIFF GIF PNG SOUND DBUS GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95129 7264) (symbols 48 20393 1) (miscs 40 41 120) (strings 32 28284 1631) (string-bytes 1 747257) (vectors 16 14056) (vector-slots 8 497402 8748) (floats 8 49 68) (intervals 56 224 0) (buffers 992 12)) --=20 Google Germany GmbH Erika-Mann-Stra=C3=9Fe 33 80636 M=C3=BCnchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado If you received this communication by mistake, please don=E2=80=99t forward= it to anyone else (it may contain confidential or privileged information), please erase all copies of it, including all attachments, and please let the sender know it went to the wrong person. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 19 10:31:28 2017 Received: (at control) by debbugs.gnu.org; 19 Nov 2017 15:31:28 +0000 Received: from localhost ([127.0.0.1]:47677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGRZA-0000u6-JF for submit@debbugs.gnu.org; Sun, 19 Nov 2017 10:31:28 -0500 Received: from mail-it0-f48.google.com ([209.85.214.48]:36953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGRZ9-0000ts-0W for control@debbugs.gnu.org; Sun, 19 Nov 2017 10:31:27 -0500 Received: by mail-it0-f48.google.com with SMTP id m191so9147706itg.2 for ; Sun, 19 Nov 2017 07:31:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=r7gMO7ameSi3c3hKHoajQCJ/zxz2mo+b0cNXwJVAiyA=; b=eNwk66miDASkdMPWgK2uoi5VLQGdykZZEepG3x40HP09Ga2evIQX6R1y/Wy7Sn8oiU rg7FJcAXXIlyYhduwIISVfsZzJRbb6JOeb6S+/IUki8h7jHEdx2Kg25bl+CLRer6jtSN tlVvzqZWTz92V8wy6wjSph55kDhY6N5X7lsHgGKqlr/YHVPFHWffSDKG8+bK1qo0hU2j pd7ttl5f5RCoRImkFM4Si6Dig36wBusIkPBr/vA4CKRy2vq7fq8s91QzNosLbznah3Ez 6vWw0S+bAlQ5TtDTOQNbPWYRSfRvEXUUB3BEhGj+3eJVPlvrBhwPJA1J+cN60ohH4GgE TPXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=r7gMO7ameSi3c3hKHoajQCJ/zxz2mo+b0cNXwJVAiyA=; b=haONoKZXSE+/ZD57dWFWekbBvM1ML2QkxVntxEUR5vamfDWo2YPHoHOmkNOfJ+y3KN qu8Wk8ilIg0UlInS+vP53kZvzgh7ia7Ejr0vHo4GO1lLd97A2D6aoA1OAnkj8Nj5rHz7 OILETkVHUBRX5AtB+U6D421JX41G8o4gN4i9+nZY1Bs8oS0r8jZSoii18IiQC57sYk7H 7DYz70TFpRfk0K2viAxZoA9YDR+DYD54d4UMTEo2o8cyWFmfoUV31oEhCFezRJZdBum7 NIU3W4uatBo7r6AsojGqb8dVRoLppDQDsiKeKu68G17ZOYF7zucFrtj5seP1/zej6CSH Qfvg== X-Gm-Message-State: AJaThX7IOnFauRtsLZl+TTiReIBtcdM6BbiCPwqT2vAwacWLfqQGiCBy rl9qumaiCwukAtL23MgEMOHrHg== X-Google-Smtp-Source: AGs4zMZxBplLa7/hV0mIeEBY5HbrU3xRf0quDCOZwPH2s4YSVXN4l9Kh440YqwZ70gi5j5eou2ZR6g== X-Received: by 10.36.67.149 with SMTP id s143mr13918730itb.64.1511105481276; Sun, 19 Nov 2017 07:31:21 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id i33sm3612367ioo.64.2017.11.19.07.31.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 Nov 2017 07:31:20 -0800 (PST) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message for bug #29343 Date: Sun, 19 Nov 2017 10:31:19 -0500 Message-ID: <877eum1e0o.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control 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 (/) severity 29343 minor retitle 29343 Match data doesn't contain elements for trailing non-matched subgroups quit From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 16 09:29:29 2017 Received: (at 29343) by debbugs.gnu.org; 16 Dec 2017 14:29:29 +0000 Received: from localhost ([127.0.0.1]:36531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQDSz-0000EM-Ld for submit@debbugs.gnu.org; Sat, 16 Dec 2017 09:29:29 -0500 Received: from mail-qt0-f180.google.com ([209.85.216.180]:33996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQDSy-0000EB-LW for 29343@debbugs.gnu.org; Sat, 16 Dec 2017 09:29:28 -0500 Received: by mail-qt0-f180.google.com with SMTP id 33so15415603qtv.1 for <29343@debbugs.gnu.org>; Sat, 16 Dec 2017 06:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=KUu90OE0NAedt4fj5qgPfzi11V+t+2ojgbNGjYNHnzE=; b=ui9TnbFMH74D8S/4YzyGXTBTfRJk2MNwJQeyUgAQP+mZu07gffIMb2kMszu4DuAhs4 9GG/kCOQwYxUfRE0hP+QDtsZh0AGm4FzhZHbOBoc7M963P5hDrNWRQ8ok4X0oVe1BexO dq5vy4SUjpMWlKsSx7O4egyMk/gk2eqx+6OYnNvyj/Lqt0F7QhGVZbxKO0iA2S8scJUB uauKa3JKNdRtNhnMuBYTirgG9EtNb7UTWXeCWTzi10RcP/TUDCt/OTWhpgukNkD68yj8 eaRBJ0O17DdoRjX3sAHNly1bjmG81k9gVw+Et2Gp9uA6WqEh2yifK97LGs7KFAChb2H2 eweA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=KUu90OE0NAedt4fj5qgPfzi11V+t+2ojgbNGjYNHnzE=; b=tXQTlySuZqkduAlp7FCrEjoriUZBG5Sy8v2hyxReXL799oYT27IcB2YWbpkruRIPH0 5EpfsGQZ5dn9diV5ultvtQKVzd2aXpZuEj4KAc+5FDTXOmzbMLvygljNIECi1dk+mw+i FqeY3Hmc4cUsvR8/A4PVcCvk6KyjkNCCJhCyPkIdDmj4msycgptdpnNED2so8drSzTQL 19XTgTp4p8hdXDNtxIna9GDxIdl5zyyNgFQLYnvvbPLEzIRxfG76lrzo/mkThstvRioh LPdTbzKAiDaNlMMyfYtYwq32TftFs1YfsOze2MbJB0WyOcUBjNwtsX3ICfkqiXLEdZcW f8nA== X-Gm-Message-State: AKGB3mKW2kR92s+aNUu/4nuIAkXfMluimd2awsJohZz3ImiouIW0G16e L0IcGSR3neoUcpg5MLAxwF2w7J5L7lmGUqNeGPvF7A== X-Google-Smtp-Source: ACJfBovfgJzSpRrRNxD0ZC/pNiib/XGyNi5fTCu3kQsKEXstNTiv491K3sTmmR+MOLXgThklUM+I7AetgrqA9sWNG0c= X-Received: by 10.200.23.20 with SMTP id w20mr4384488qtj.210.1513434562789; Sat, 16 Dec 2017 06:29:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sat, 16 Dec 2017 14:29:12 +0000 Message-ID: Subject: Re: bug#29343: 27.0.50; Match data doesn't contain elements for non-matched subgroups To: 29343@debbugs.gnu.org Content-Type: multipart/alternative; boundary="001a11481742818646056075f1e9" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29343 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.2 (/) --001a11481742818646056075f1e9 Content-Type: text/plain; charset="UTF-8" Philipp Stephani schrieb am Fr., 17. Nov. 2017 um 21:12 Uhr: > > $ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(c\\)?$" > "b") (print (match-data)))' > (0 1 nil nil 0 1) > > Note that neither the `a` nor the `c` group matched, but there are > entries for `a` in `match-data`, but not for `c`. This makes working > with the match data unnecessarily hard because its length depends on > whether certain optional groups have matched or not. I haven't seen any > discussion about this behavior in either the manual or the docstring. I > think the match data in this case should be (0 1 nil nil 0 1 nil nil). > > It turns out that this is harder than I expected, because the information about the number of groups in the pattern isn't stored anywhere, and search_regs.num_regs may be different from the group count. If it turns out too hard to fix, the behavior should at least be documented. --001a11481742818646056075f1e9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Fr., 17. Nov. 2017 um 21:12=C2=A0Uhr:

$ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(= c\\)?$" "b") (print (match-data)))'
(0 1 nil nil 0 1)

Note that neither the `a` nor the `c` group matched, but there are
entries for `a` in `match-data`, but not for `c`.=C2=A0 This makes working<= br> with the match data unnecessarily hard because its length depends on
whether certain optional groups have matched or not.=C2=A0 I haven't se= en any
discussion about this behavior in either the manual or the docstring.=C2=A0= I
think the match data in this case should be (0 1 nil nil 0 1 nil nil).


It turns out that this is harder than I ex= pected, because the information about the number of groups in the pattern i= sn't stored anywhere, and search_regs.num_regs may be different from th= e group count. If it turns out too hard to fix, the behavior should at leas= t be documented.
--001a11481742818646056075f1e9-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 16 20:37:49 2018 Received: (at 29343) by debbugs.gnu.org; 17 Mar 2018 00:37:49 +0000 Received: from localhost ([127.0.0.1]:37431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewzr3-0000zV-AE for submit@debbugs.gnu.org; Fri, 16 Mar 2018 20:37:49 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:42839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ewzr2-0000zK-75 for 29343@debbugs.gnu.org; Fri, 16 Mar 2018 20:37:48 -0400 Received: by mail-io0-f170.google.com with SMTP id d5so12372iob.9 for <29343@debbugs.gnu.org>; Fri, 16 Mar 2018 17:37:48 -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; bh=TC+bCu3SB5Txo+s5XfZB3JcI9kTxauzRXFonrZB3Tv4=; b=i2p6MpUp0/dBpL/ZfEfs/NX+3QZyyYlPKYYaBs836CF/4OxWS4OOArDKrlXH0rzDW5 4WB1/51E1ygYasPpjJnPbkTMTFxTK09GVz7eG6SuG1Jka/chB96VzUu66h0GlggVIUa5 DgfAAu2YoNuCpEz83P2ah3N/LNT8GXl6iwjOBGO7sjQXFHErBTYqXQd+uQ4/3gGC66gN SvjbZYRTIqd1WIxUES+ZB/n5s3mFjpVBsxrGEk2yqUiD5Fk1Bj6CSMTB0x+JZQLiPOfx wuJWjHb1/fgmIS/IFUJ9CP9lYiXLbMnLSHU/DjbxKKzgRAg6Q59UadQNxFYAbqU9YEe7 JVTw== 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; bh=TC+bCu3SB5Txo+s5XfZB3JcI9kTxauzRXFonrZB3Tv4=; b=codvXyRO1dr0am84/WZynX4eO+WUgLUzrs4rsy6qLgaxw3NTTkVlIdpKXX1oXGOHFz sd2XH3VnkFSPNTQ/polH3xnXuGaXTNcWAktxh9YDFcV9DZTIutlsNE9F9yczlYLFkQYG mm2jh497kh4v8UxX+EGvzqYWpbZ/PHi7NtM9eK67PXrZhgTkywUzXsowt5dyrwDZ4gj7 dczKIgsE0EVR6zrFeoAhIV8hYda3CDu1LfZhf4Oe7Fi8L88qwnLsbMGVvHA/WanI2PEI 4wfl/UXeBc/kK1eDJTMiHvCBOwoIe3gazd/1DxpWizJLTTBDzD6bMQEcFuBY2qFjuu5/ mH0g== X-Gm-Message-State: AElRT7FhM7aJ4uzUxgiQ6mehAOR6fYW+SWf7FbuRfx6G+fGTfZ4AG4fz 0HNODu4TpxEudQFpSPni+AQCAA== X-Google-Smtp-Source: AG47ELtRc2bUFtrZWivR8xP4HltnnBCMv0vrZ16OMZM3dnEsI2RhJV40NLdGrJyJzbQ+tfwJHz40Uw== X-Received: by 10.107.79.23 with SMTP id d23mr3763975iob.269.1521247062588; Fri, 16 Mar 2018 17:37:42 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g11sm5621271ioe.20.2018.03.16.17.37.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Mar 2018 17:37:41 -0700 (PDT) From: Noam Postavsky To: Philipp Stephani Subject: Re: bug#29343: 27.0.50; Match data doesn't contain elements for non-matched subgroups References: Date: Fri, 16 Mar 2018 20:37:41 -0400 In-Reply-To: (Philipp Stephani's message of "Fri, 17 Nov 2017 21:11:13 +0100") Message-ID: <87in9vv8oa.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29343 Cc: 29343@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.0 (/) Philipp Stephani writes: > $ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(c\\)?$" "b") (print (match-data)))' > (0 1 nil nil 0 1) > > Note that neither the `a` nor the `c` group matched, but there are > entries for `a` in `match-data`, but not for `c`. This makes working > with the match data unnecessarily hard because its length depends on > whether certain optional groups have matched or not. I haven't seen any > discussion about this behavior in either the manual or the docstring. I > think the match data in this case should be (0 1 nil nil 0 1 nil nil). You can get that result by passing a list of the expected length as the REUSE argument to match-data: (progn (string-match "^\\(a\\)?\\(b\\)\\(c\\)?$" "b") (match-data t (make-list 8 nil))) ;=> (0 1 nil nil 0 1 nil nil) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:22:44 2019 Received: (at 29343) by debbugs.gnu.org; 19 Apr 2019 18:22:44 +0000 Received: from localhost ([127.0.0.1]:44594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHY9s-0002qa-1S for submit@debbugs.gnu.org; Fri, 19 Apr 2019 14:22:44 -0400 Received: from mail-oi1-f181.google.com ([209.85.167.181]:46084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHY9p-0002qG-D7 for 29343@debbugs.gnu.org; Fri, 19 Apr 2019 14:22:41 -0400 Received: by mail-oi1-f181.google.com with SMTP id x188so4511327oia.13 for <29343@debbugs.gnu.org>; Fri, 19 Apr 2019 11:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sSKT1QAw6SWnKvtMt7aM8nEvqxb7poCp3NmGB+RbQ/0=; b=tkmEBDPMrCg0/ZW5QadFcNpuWRpAqy6hI/mCldqtY2mRoU3IvWb7W3cggMhwt4H8Iz Eet+lPX1aP91LqKvOmq+jZVURGueOLyfD1W8/Uf4fesyB7WiVnKHZ755GMxxvQHSrurr 9UaOSIob9i+uSQvlCMZAxjPw/UG63Hf6TbFyjGuOfoqP6QH/LopufZc/58z3ky83fBm/ DDWcA7+vc5yIhlFv1QCuP2YQcDS9ARmmybHAnKeonyoJwWpJi6PNTbm89Henj9tbYgIQ weGNBzPlhCWWNwJVuSiz4wy64kA5fx8C1EHQSu0AkdyESQyawNvPGiLESfx2kQ2cUW65 Nx0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sSKT1QAw6SWnKvtMt7aM8nEvqxb7poCp3NmGB+RbQ/0=; b=X86pL1xEV2tPfkdgJvqbH4/YbAu+6aLg87k8SDYtktydISGtBW+0+70BDpWhYbz3If zbf75O5MoODps8Xgy/htypsgheTNbeYCoy3HfQW8MeU5i5FS7tszthlfQn3Ry6YQCQbX xyn6MB01pzoQFhr7W2mLMbhKT2fRcFAMeBVjICPNB6nvejQoDiOoPVfcHo3bLRlH+zJs bZhuAMvF/XBctguuPTYwvWqrua1OrUGSdxJgMCyirxJW67vk97SeReW6ulJWBWL3uB6F 73n8c7oGsDf+b2BnEs5gAbCfb3ocx8B7EmrcCpHki46HrnVfXSEqohCnwlHUj0CpkFcU 7IAg== X-Gm-Message-State: APjAAAXtjFjquWBSMgGni+6B6j3WEw0UZeLYU9Dm59FTuMRkEixMXKPU k5OklRURq2rIPEgxJCXohPQawhHZXUcd7/P2ixg= X-Google-Smtp-Source: APXvYqzHBsUGpugkHXnrVPLiPE/FLDp2AIQ5DdZbXbV+YGsQzZrLqsjIrxTAuBbdMX0hF0v7KJQgQt0GBo0GXYx6tVs= X-Received: by 2002:aca:d90a:: with SMTP id q10mr2873848oig.65.1555698155234; Fri, 19 Apr 2019 11:22:35 -0700 (PDT) MIME-Version: 1.0 References: <87in9vv8oa.fsf@gmail.com> In-Reply-To: <87in9vv8oa.fsf@gmail.com> From: Philipp Stephani Date: Fri, 19 Apr 2019 20:22:23 +0200 Message-ID: Subject: Re: bug#29343: 27.0.50; Match data doesn't contain elements for non-matched subgroups To: Noam Postavsky Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 29343 Cc: 29343@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.8 (/) Am Sa., 17. M=C3=A4rz 2018 um 01:37 Uhr schrieb Noam Postavsky : > > Philipp Stephani writes: > > > $ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(c\\)?= $" "b") (print (match-data)))' > > (0 1 nil nil 0 1) > > > > Note that neither the `a` nor the `c` group matched, but there are > > entries for `a` in `match-data`, but not for `c`. This makes working > > with the match data unnecessarily hard because its length depends on > > whether certain optional groups have matched or not. I haven't seen an= y > > discussion about this behavior in either the manual or the docstring. = I > > think the match data in this case should be (0 1 nil nil 0 1 nil nil). > > You can get that result by passing a list of the expected length as the > REUSE argument to match-data: True, but that also requires knowing the expected length. In the most general case this should work for unknown regular expressions. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:29:38 2019 Received: (at 29343) by debbugs.gnu.org; 19 Apr 2019 18:29:38 +0000 Received: from localhost ([127.0.0.1]:44600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHYGX-00031U-Oi for submit@debbugs.gnu.org; Fri, 19 Apr 2019 14:29:38 -0400 Received: from mail-qk1-f169.google.com ([209.85.222.169]:45559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHYGV-00031E-Ad for 29343@debbugs.gnu.org; Fri, 19 Apr 2019 14:29:35 -0400 Received: by mail-qk1-f169.google.com with SMTP id d5so1055549qko.12 for <29343@debbugs.gnu.org>; Fri, 19 Apr 2019 11:29:35 -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=pOYAsjBIqda0AYtTVTP6fh4WmNZmuhMy9Hp60hjcasQ=; b=rD02+KvQ1hEqXNdWAhYgFsFkgf2tQSpmI4H58GoHHUBnT/cXVMc92Pj4d7QjO1e3F3 zSiyXSlsjrjwGAiQ63TeGMO9T4C9ekXB/n8bTQvwBbOjechLSpxgjq9M8rYdSWMYKDK1 bYr5tQMb5LIVeiGmMqJXypBNJ8hr1E1dyIB478u+BZZQEzkYtHA/hVa0ZuUx1eWYDU5X ow52nS+g2x4qv0qhjBsuvFJ1sUqt/lgue981cYuxoDkmdsVnS99BPseoxOfzPg0ymcXW +PYnsC0A+/8MkJQgxZZ8UhwMOvUgG8/Wldj01VdHpp7pe4totxFMsfdts31DN7Y+VJJD jihA== 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=pOYAsjBIqda0AYtTVTP6fh4WmNZmuhMy9Hp60hjcasQ=; b=MMV3HLwhkNRRn+AWTbM7nMaPStZIqP3AVWLbHSbMW6+swRuWvP4zdTLPXSQgKHHz1d l0/KLXeeHRLtN46+MnVzLHRvsf4+lfXhpAU13Wwt6CIa08YmvjcruWFOn6EQ3HCPPgfI bH4hpw105mMQ/EYPA63ay11P8w1LaXbLOXOpboGRN13stIFJPBfaIDcotP1Ean84kKNq R/X01IwniwhKfiGKyQ+zePf0pJbXyA+wsebCVZKsHcV97KOSzFwnF0rXOVeU7WZsKH9g HzY50M7TmaXhXdibPQgRzqLAr72NwLVzIKoiydvoK4aRNEO2RguEJRSZqorZWEhn3ND7 gNMg== X-Gm-Message-State: APjAAAX8xLD26otgAc8yMZBiO6AJl2Ql3RCNIW+9GqXlefpSuu5bxPdy UtHX9cTqRPfCg0mXi6LHw+uSYASd X-Google-Smtp-Source: APXvYqx8JLweQZDPuqoqgo7NlBokGN+aSTqpmh9FFx7MldYo8U2XON1rpvSz633kGHqTJ1fKxFRcKQ== X-Received: by 2002:ae9:f202:: with SMTP id m2mr4198241qkg.52.1555698569666; Fri, 19 Apr 2019 11:29:29 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id t2sm3324771qkd.57.2019.04.19.11.29.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 11:29:28 -0700 (PDT) From: Noam Postavsky To: Philipp Stephani Subject: Re: bug#29343: 27.0.50; Match data doesn't contain elements for non-matched subgroups References: <87in9vv8oa.fsf@gmail.com> Date: Fri, 19 Apr 2019 14:29:27 -0400 In-Reply-To: (Philipp Stephani's message of "Fri, 19 Apr 2019 20:22:23 +0200") Message-ID: <87muklvofs.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29343 Cc: 29343@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: -1.0 (-) Philipp Stephani writes: > Am Sa., 17. M=C3=A4rz 2018 um 01:37 Uhr schrieb Noam Postavsky : >> >> Philipp Stephani writes: >> >> > $ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(c\\)= ?$" "b") (print (match-data)))' >> > (0 1 nil nil 0 1) >> > >> > Note that neither the `a` nor the `c` group matched, but there are >> > entries for `a` in `match-data`, but not for `c`. This makes working >> > with the match data unnecessarily hard because its length depends on >> > whether certain optional groups have matched or not. I haven't seen a= ny >> > discussion about this behavior in either the manual or the docstring. = I >> > think the match data in this case should be (0 1 nil nil 0 1 nil nil). >> >> You can get that result by passing a list of the expected length as the >> REUSE argument to match-data: > > True, but that also requires knowing the expected length. In the most > general case this should work for unknown regular expressions. I don't understand how the general case you describe could occur. If you don't know the expected length, that means you don't what groups are in the regexp, so you can only rely on group 0 existing, i.e., you only care about the first two elements in the match-data. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:42:42 2019 Received: (at 29343) by debbugs.gnu.org; 19 Apr 2019 18:42:42 +0000 Received: from localhost ([127.0.0.1]:44609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHYTC-0003Ne-7o for submit@debbugs.gnu.org; Fri, 19 Apr 2019 14:42:42 -0400 Received: from mail-ot1-f49.google.com ([209.85.210.49]:40301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHYTA-0003NR-Ln for 29343@debbugs.gnu.org; Fri, 19 Apr 2019 14:42:41 -0400 Received: by mail-ot1-f49.google.com with SMTP id t8so4982180otp.7 for <29343@debbugs.gnu.org>; Fri, 19 Apr 2019 11:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rG3A7qXa0omC6lBEeUwuGwZoauJ5Y04R/NFytptxfLg=; b=O63zYyoiobJqpPvRwLnWHyGt1UDynHzrNx0LLH+UwDuGk/yf2/M5jY+4pWePKMUKnm 9g1yrhn7FFW8Jn2iRrKL1fTfxaVrDljAwGLv4FM7ru08ygAJytIHRmO4xXlVid3UxAcx /8Qr+sAC4oF5BlDIcN4Uy5K2HydgML1/a4aQFpaGFxBlofmZAxgcc2TaddHRyxhS/pGU nJ8qGY/Q24B9YMMIdf7O1aSLY+fXVgudyLo5xdxcFAgCY3C1tgn57tpI8BH+sUVdfD0U 9Q/ZoMebV9C1d/jdvhW6DE9M5DhNMa5Yku5tXFsPtIFMmNFOOx0At+IolvjPqO6iErwd mMTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=rG3A7qXa0omC6lBEeUwuGwZoauJ5Y04R/NFytptxfLg=; b=Uf0ovpdwum5csyiLUksDCRJGeLJ74qGLAkLZE6ZpHNPZVTSZzjrKAG3KvSAvu+yBKi IaY0aQ3Rm0XceINcl7k3gAz4uaYL8QFofY7d2oV626TfzyfTNiAOhx1giwc299rL2grS PEoR12jQz2Cqi5oExKSmbo9k8XzQeMPRdcb5Xc+O23xew9U8fcBRM5vB/L2Teu6+0zGo dD3DL3nszCYsCXGxDAIMMTsJ+P9O5jbHlfwCuBh/d4Vmrj8x5srUQ6L45dhreodNUyvG UGE3cy+W9Fw7r0Qs9f30nKVjh29VPS9Nr62uvcH50ZvwMMAYeGD+fyrr7wVkCfV5ww76 LjRg== X-Gm-Message-State: APjAAAXRETFTqPdC1nxIoUPhwCn+nSJiqK21PMopEfGz7c269nANsjE1 r21vxf9QQoQ0Kb3R6dPL1WVxUpGH1GfcSzZaEMk= X-Google-Smtp-Source: APXvYqxONfsP9vqzHySssNXS8J7WK3nANODaHqff5G64eXd37mVFK7gHfu2uGdO/xPTZMvTR950ujTnwNHLbSK6uTi4= X-Received: by 2002:a05:6830:15d2:: with SMTP id j18mr2893966otr.37.1555699354470; Fri, 19 Apr 2019 11:42:34 -0700 (PDT) MIME-Version: 1.0 References: <87in9vv8oa.fsf@gmail.com> <87muklvofs.fsf@gmail.com> In-Reply-To: <87muklvofs.fsf@gmail.com> From: Philipp Stephani Date: Fri, 19 Apr 2019 20:42:23 +0200 Message-ID: Subject: Re: bug#29343: 27.0.50; Match data doesn't contain elements for non-matched subgroups To: Noam Postavsky Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 29343 Cc: 29343@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 (/) Am Fr., 19. Apr. 2019 um 20:29 Uhr schrieb Noam Postavsky : > > Philipp Stephani writes: > > > Am Sa., 17. M=C3=A4rz 2018 um 01:37 Uhr schrieb Noam Postavsky : > >> > >> Philipp Stephani writes: > >> > >> > $ emacs -Q -batch -eval '(progn (string-match "^\\(a\\)?\\(b\\)\\(c\= \)?$" "b") (print (match-data)))' > >> > (0 1 nil nil 0 1) > >> > > >> > Note that neither the `a` nor the `c` group matched, but there are > >> > entries for `a` in `match-data`, but not for `c`. This makes workin= g > >> > with the match data unnecessarily hard because its length depends on > >> > whether certain optional groups have matched or not. I haven't seen= any > >> > discussion about this behavior in either the manual or the docstring= . I > >> > think the match data in this case should be (0 1 nil nil 0 1 nil nil= ). > >> > >> You can get that result by passing a list of the expected length as th= e > >> REUSE argument to match-data: > > > > True, but that also requires knowing the expected length. In the most > > general case this should work for unknown regular expressions. > > I don't understand how the general case you describe could occur. If > you don't know the expected length, that means you don't what groups are > in the regexp, so you can only rely on group 0 existing, i.e., you only > care about the first two elements in the match-data. > The context here is https://github.com/magnars/s.el/pull/117. Normally you'd expect something like Python's Match.group (https://docs.python.org/3/library/re.html#re.Match.group), i.e. a group match per defined group, even if the group didn't match. That Emacs doesn't behave this way is surprising and should at least be documented. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 14:54:12 2019 Received: (at 29343) by debbugs.gnu.org; 19 Apr 2019 18:54:12 +0000 Received: from localhost ([127.0.0.1]:44615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHYeK-0003g2-DO for submit@debbugs.gnu.org; Fri, 19 Apr 2019 14:54:12 -0400 Received: from mail-qk1-f175.google.com ([209.85.222.175]:45689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHYeI-0003fn-24 for 29343@debbugs.gnu.org; Fri, 19 Apr 2019 14:54:10 -0400 Received: by mail-qk1-f175.google.com with SMTP id d5so1085145qko.12 for <29343@debbugs.gnu.org>; Fri, 19 Apr 2019 11:54:09 -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; bh=Qp1gYK3zMuuzAmzVrcMv+qnHCjxYyNcHcL56CRgpZVI=; b=Qnm2TnQj5CiuPfQcRq4fhyt3ibWf0203xh7WEHyoYEUe7griQnyDy5LfnA5GsaFEzc GiDdO66E0haKf9f3VRPaGeTipQuihF0TSWHpD79SpUY5rfkbkm3HI/LKgzB37WGB0YvF b4dfvXVI8vYKHsPh9O4t1xA8vsSkegT2kYIkZ4/LdPhxe3yl/+iBN5W4Q0j7TnGIFKrI LgMvyk6HdGUrueAar7gPW6lrn8/FS78CrxLFOdHbvhbnDmM0tNHk0wvSToZqitDDCsmS E75y/obA7dFzszRlkymmrRwM9ldgngXhLIGfhxJ49z0nrO0l5TZB6L4HW+yQV6OStqAn ZgGA== 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; bh=Qp1gYK3zMuuzAmzVrcMv+qnHCjxYyNcHcL56CRgpZVI=; b=a3JqTSecpLEV5z0dai9k3+FiW7/KsmE+8yhx4smp2D7eyT+FqtipUiDi8XvMljWd9U Bn9z4Ee0A3J9dqiLxowrOSr4oUiGIRdjCXkT3pXaoZa2D+xeR41qCCX7sFwb9T7WUzxy aj2UTaUd6N6pDzOjyfjeBWriBr8eF7hWUISZ73YtLXCybC+A7N8/Fkx/UVKcxH10Y2fP 9E69W094jiOMYjXUVEpMCe/XU1Qiww1VOmVLX+CopMrWVCArffLR7Bmpk0U6D+5lRPko 96xSEw9pYg/mTAr68pt3NtDGjItCXO1LcfP5nU2eSRqEU5/YZwe6LTWWh5g5R3Ul8lQP /iIA== X-Gm-Message-State: APjAAAU8+bjaGCD3fZ3kMSv4N055iv0nuV1fQapTLiEsfenmXYxhnzqn W8ZiTgSTq/jfksbElIuoiAGQaT5b X-Google-Smtp-Source: APXvYqxdmPqoArcykuYrRkiMTh0hECzvj0lWzhgUuSgn8A+HH0o2ZSlRWNubWK6gzQOi1phF8Z+JdQ== X-Received: by 2002:ae9:e518:: with SMTP id w24mr4540471qkf.237.1555700044322; Fri, 19 Apr 2019 11:54:04 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id z38sm3073740qtz.13.2019.04.19.11.54.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 11:54:03 -0700 (PDT) From: Noam Postavsky To: Philipp Stephani Subject: Re: bug#29343: 27.0.50; Match data doesn't contain elements for non-matched subgroups References: <87in9vv8oa.fsf@gmail.com> <87muklvofs.fsf@gmail.com> Date: Fri, 19 Apr 2019 14:54:01 -0400 In-Reply-To: (Philipp Stephani's message of "Fri, 19 Apr 2019 20:42:23 +0200") Message-ID: <87k1fpvnau.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 29343 Cc: 29343@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: -1.0 (-) Philipp Stephani writes: >> >> You can get that result by passing a list of the expected length as the >> >> REUSE argument to match-data: >> > >> > True, but that also requires knowing the expected length. In the most >> > general case this should work for unknown regular expressions. > The context here is https://github.com/magnars/s.el/pull/117. Ah, I see, the problem is that s-match is trying to present a "nicer" interface, so it doesn't have a REUSE argument. > That Emacs doesn't behave this way is surprising and should at least > be documented. Yeah, no argument there. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 10:40:16 2022 Received: (at 29343) by debbugs.gnu.org; 29 Jan 2022 15:40:16 +0000 Received: from localhost ([127.0.0.1]:34506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDppo-0006ft-CZ for submit@debbugs.gnu.org; Sat, 29 Jan 2022 10:40:16 -0500 Received: from quimby.gnus.org ([95.216.78.240]:53960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDppm-0006fZ-UG for 29343@debbugs.gnu.org; Sat, 29 Jan 2022 10:40:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3txZeOVZ3m740WUuktuBmKFNaHj4YlCiZsyMfenzDgc=; b=gRCoXXeIDf2ycUS12aKD1Eq345 2ukM8kRuFvYzFGmH9nuHfJnTepL7S0UO64xsjWh78m+z3OCqNpgrXAQoWyLMQdT1XjQB3PZk6zB1o 3EPnigifO7nZjyPKWwLCwAoIlXXkyVdwt7Z2GX1UfPabsWz5HY1MWOjTNch1kQgr7Jss=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDppe-00048C-94; Sat, 29 Jan 2022 16:40:08 +0100 From: Lars Ingebrigtsen To: Philipp Stephani Subject: Re: bug#29343: Match data doesn't contain elements for trailing non-matched subgroups References: X-Now-Playing: The Durutti Column's _Circuses and Bread_: "Street Fight" Date: Sat, 29 Jan 2022 16:40:05 +0100 In-Reply-To: (Philipp Stephani's message of "Sat, 16 Dec 2017 14:29:12 +0000") Message-ID: <878ruya6ui.fsf_-_@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philipp Stephani writes: > It turns out that this is harder than I expected, because the > information about the number of groups in the pattern isn't stored > anywhere, and search_regs.num_regs may be different from the grou [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 29343 Cc: 29343@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: -3.3 (---) Philipp Stephani writes: > It turns out that this is harder than I expected, because the > information about the number of groups in the pattern isn't stored > anywhere, and search_regs.num_regs may be different from the group > count. If it turns out too hard to fix, the behavior should at least > be documented. I've now mentioned this in the doc string in Emacs 29. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 10:40:21 2022 Received: (at control) by debbugs.gnu.org; 29 Jan 2022 15:40:22 +0000 Received: from localhost ([127.0.0.1]:34509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDppt-0006gF-KG for submit@debbugs.gnu.org; Sat, 29 Jan 2022 10:40:21 -0500 Received: from quimby.gnus.org ([95.216.78.240]:53974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDpps-0006fl-3D for control@debbugs.gnu.org; Sat, 29 Jan 2022 10:40:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=v8SGBES+bgn3xnIwgZ4XXPODthhUX3LElg4ZHEsl8GU=; b=ExO3Ut4Uw/34eqb5ecS7WGxQeK uQoqEVDa9MBNvjULYI5n8fIwlGUFeqUCJkDbbiMWKmGrGuAfjaN4k51dInGCYsAYHH5FgSqLh5Ylj 5NblnNE05LLjgAtNYlY4xnY+5/uxuWEG+yiQVlok6IHInCLKpw1OC7nQ9Y0zpP0WzkZY=; Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDppk-00048P-89 for control@debbugs.gnu.org; Sat, 29 Jan 2022 16:40:14 +0100 Date: Sat, 29 Jan 2022 16:40:11 +0100 Message-Id: <877daia6uc.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #29343 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 29343 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) close 29343 29.1 quit From unknown Mon Jun 23 13:09:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 27 Feb 2022 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator