From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74861: 31.0.50; etags no longer processing shy groups as expected in --regex options Date: Sat, 14 Dec 2024 10:33:53 +0200 Message-ID: <86bjxewtn2.fsf@gnu.org> References: <20241213160630.82sGx%dvilleneuve.4142@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9073"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74861@debbugs.gnu.org To: dvilleneuve.4142@gmail.com, Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 14 09:35:22 2024 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 1tMNcQ-0002DR-0Z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Dec 2024 09:35:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMNcB-0007lr-25; Sat, 14 Dec 2024 03:35:07 -0500 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 1tMNc7-0007ja-11 for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 03:35:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMNc6-0008I5-Nd for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 03:35:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=3awth5ShtiMZ0K6qB/N73ct+pyMBRZwbcctHo8fYvcc=; b=k6GfGAgtHmAvsNeJcj56c7atbTL+556Pzg2/tNdGUywjEJ4DM7C2dSKrO170D1AdMu9+eJjw3+ITptWrh2R3O7B3prhoIsAJGDe4g12K6w3efgc53B2QL2azGHnZkLU1JMxB/+ybjZpILbxgPZ74FGBHbqRGDHtIRFNabwNJaXmYgVrPh6BhNL9qWea8YnoFvpN5X+37vZEH5fukTTjuLvmooluPqFB/CI5WczBJzYYma6fjdoxiPVnXMOozknJO4gtwSK2I794pKVWFLPilLSrujoD40RBiDLAVfEfkRfKUQPoEhnsxpZ5OBHT655rgxWHCfgC57ea7RR9MVPdd1w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMNc6-0003ix-G6 for bug-gnu-emacs@gnu.org; Sat, 14 Dec 2024 03:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2024 08:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74861 X-GNU-PR-Package: emacs Original-Received: via spool by 74861-submit@debbugs.gnu.org id=B74861.173416524814228 (code B ref 74861); Sat, 14 Dec 2024 08:35:02 +0000 Original-Received: (at 74861) by debbugs.gnu.org; 14 Dec 2024 08:34:08 +0000 Original-Received: from localhost ([127.0.0.1]:45344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMNbD-0003hP-RF for submit@debbugs.gnu.org; Sat, 14 Dec 2024 03:34:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMNb9-0003gt-E0 for 74861@debbugs.gnu.org; Sat, 14 Dec 2024 03:34:04 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMNb3-0008Cn-7q; Sat, 14 Dec 2024 03:33:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3awth5ShtiMZ0K6qB/N73ct+pyMBRZwbcctHo8fYvcc=; b=hGeI6ApnDD0o cBRFk4PqtCI6OAu2Fodj6bh9lsGesNp6xjV19azbJwPDRyYUDtzv94bVFFyMiAvvMvBl0fblPlTA2 WPHYqOmiPKLDo6yvU9OKQe4ciikM0t2hw5r1tfPhbHAccDg35wA0BCbarfb/ScGW4dRPJK+u7TCdc +Ah/ngqZxiAYx/SVoa9dg4ZKCpqnyxHb4YkPrbsSyFqYURUIVYISa3fH/I5hSM75jau+m/GggSJCU Q6OmaXeLRpog8vX7JvXC45iFts8wh7ja8w1wsYqdaLRxT78bXbKEtpcesiBV+0mn70OdHOcAcB6hK sqAumK/MFhLFSjKyBvbkKQ==; In-Reply-To: <20241213160630.82sGx%dvilleneuve.4142@gmail.com> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297012 Archived-At: > Date: Fri, 13 Dec 2024 11:06:30 -0500 > From: dvilleneuve.4142@gmail.com > > On a C file (foo.c) with the following line: > > DEFINE_FF(TAG func) > > the etags command used to tag "func" (version 26.1): > > etags --regex='/DEFINE_FF *(\(?:TAG \)? *\([^)]+\)/\1/' \ > --output ETAGS-test foo.c > > produces > > $ od -c ETAGS-test > 0000000 \f \n f o o . c , 2 8 \n D E F I N > 0000020 E _ F F ( T A G f u n c 177 f u > 0000040 n c 001 1 , 0 \n > > so "func" between \x7f and \x01. > > With versions 27.2 and later, we get: > $ od -c ETAGS-test > 0000000 \f \n f o o . c , 0 \n > 0000012 > > so no match, and replacing \1 by \2 in the --regex argument > (admittedly not well defined since there is a single registered group), > we get: > > $ od -c ETAGS-test > 0000000 \f \n f o o . c , 3 2 \n D E F I N > 0000020 E _ F F ( T A G f u n c 177 T A > 0000040 G f u n c 001 1 , 0 \n > > so "TAG func" between \x7f and \x01. > > In both cases the result is different from the one from 26.1, > which I would think is the expected one. > > Using > > etags --regex='/DEFINE_FF *(\(TAG \)? *\([^)]+\)/\2/' \ > --output ETAGS-test foo.c > > (that is, without a shy group) works as expected, in 26.1 and later. I'm guessing this is because Emacs 27 switched to the Gnulib's regex implementation in etags and other lib-src programs, whereas previous versions used the Emacs's own regex code (which is still used for Emacs's own regex search and replacement code). CC'ing Paul Eggert, in the hope he can tell whether this is expected or not, or how to fix it.