GNU bug report logs - #46889
cperl-mode: Fix indentation issues [PATCH]

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: haj@HIDDEN (Harald Jörg); Keywords: patch; dated Wed, 3 Mar 2021 14:44:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 10 Mar 2021 14:42:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 10 09:42:43 2021
Received: from localhost ([127.0.0.1]:49456 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lK02t-0006tK-7h
	for submit <at> debbugs.gnu.org; Wed, 10 Mar 2021 09:42:43 -0500
Received: from quimby.gnus.org ([95.216.78.240]:35158)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lK02q-0006t2-Le
 for 46889 <at> debbugs.gnu.org; Wed, 10 Mar 2021 09:42:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=WZnUY+D//JLOkn77YKPdyPfJd/2z0LD1jF2n3qhe4yE=; b=Y40z57eVNUw94l6dXZm+q25h1Q
 T3cxnSTRBRDhn+Y83UPmUHRaouacPvxPlOq5L9R5Zk0UuomV6O1pKMM4ZXqEoflba+aNZ1ZpK4w5r
 c2BKeWHutNFhYz3YtHTUpho2IbDBLP2GvrQuSAj3JeDZUMd74ktHuYUd/d//p25TXVHQ=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lK02i-0004Jr-GL; Wed, 10 Mar 2021 15:42:34 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: haj@HIDDEN (Harald =?utf-8?Q?J=C3=B6rg?=)
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
References: <87im68uwld.fsf@hajtower> <877dmg9rew.fsf@hajtower>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAG1BMVEUGBQYnHyhLN0Fl
 T1iabWNxZoczMFjmza3///8F038LAAAAAWJLR0QIht6VegAAAAd0SU1FB+UDCg4qGaPe88cAAAGx
 SURBVDjLjZS9ctswDMeBpPUM0D7O+noAW2LbNYnV49whmcO4xgM0uvL1S0q2RUoeijvdifwBfxAE
 JID/MmRCVRW3NSEhB0OuwsOUOcel4rpl1dFKqVPd8WdXrlMwmmO1UAKkCJo77uhCjjv6sPkFqPo7
 NWgHsD0SAi6UtCPaNmSAlxFvBFjvd0ezPFaQwu3+cbB/1udFBdDWn3dOEMt4fFltT+JNDnAGz6va
 aWS75+UmU9XtAe1TdrHRlO0K2Pl9VkQEZlAEdkjd9QSeEB78rBTaLHF/F6/wSxKArCNwzYHwwSZn
 Qjk7ETkdhdAOlILXAGr/KdAMRdq781vwt/5v29hD2o3NawBn740fWqEMSATfvG9FHLsb+BoC5KM9
 +UFHwGUGRP94KZvvDrC5NWojo31Uyvqytn4JhBs/WgbceLneDzYHjtChMX3fmX4G8aMBfepa05q6
 Mf1hjggfk/xuyRSq5GTeNyGDloqgLmLd+J5GCE+TABwSZskv71oSgPqyQM2SgbgcWz8VOkuFIvS4
 pXMQhu3qvAA8qV3tfQaXgHBhFSf/kjA+7qqByJjOw9r+AWwcdot/3M/VAAAAJXRFWHRkYXRlOmNy
 ZWF0ZQAyMDIxLTAzLTEwVDE0OjQyOjI1KzAwOjAwxsNPXQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy
 MS0wMy0xMFQxNDo0MjoyNSswMDowMLee9+EAAAAASUVORK5CYII=
X-Now-Playing: Siouxsie and the Banshees's _The Scream_: "Hong Kong Garden"
Date: Wed, 10 Mar 2021 15:42:31 +0100
In-Reply-To: <877dmg9rew.fsf@hajtower> ("Harald =?utf-8?Q?J=C3=B6rg=22's?=
 message of "Tue, 09 Mar 2021 18:18:47 +0100")
Message-ID: <871rcnkr3c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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:  haj@HIDDEN (Harald Jörg) writes: > My patch has not been
    merged yet, and this is just as well: I'd like to > withdraw it and re-work
    parts of it. This will take a day or two (or > more). I also found that I've
    introduced a (minor) fo [...] 
 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@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 (-)

haj@HIDDEN (Harald J=C3=B6rg) writes:

> My patch has not been merged yet, and this is just as well: I'd like to
> withdraw it and re-work parts of it.  This will take a day or two (or
> more).  I also found that I've introduced a (minor) fontification bug.

Sure; no problem.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 9 Mar 2021 17:18:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 09 12:18:58 2021
Received: from localhost ([127.0.0.1]:47856 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lJg0Y-0004Lq-KR
	for submit <at> debbugs.gnu.org; Tue, 09 Mar 2021 12:18:58 -0500
Received: from mout02.posteo.de ([185.67.36.66]:57409)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <haj@HIDDEN>) id 1lJg0V-0004LZ-Fs
 for 46889 <at> debbugs.gnu.org; Tue, 09 Mar 2021 12:18:56 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id E52AF240102
 for <46889 <at> debbugs.gnu.org>; Tue,  9 Mar 2021 18:18:48 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017;
 t=1615310328; bh=b7za752S1ZwiAxsbff96DiK4DOkqSuW8Y6Guj6h3A3w=;
 h=From:To:Cc:Subject:Date:From;
 b=lstCDMPSQkZn8sEUojw0CnNMnh3fjRQTowcMCGHaSgELGdGEwy++BizwgCRrO7F6K
 M4D13JYoYtiz2I1hJ1eH8E8FX0A/frc5tFGYzB3HEUWhDLYGJDPHUj8vJjfYO1EKoB
 8WXJB9NuyVqgwRLiorKCcbcU6iBnU+uWin3Oq9H3y+3XcwN9Tvsyn8aMfM+o/9RQ+l
 zCm4fBXiE8KSS8yKrDoLJr+vyuL4lfxkx/1/akfiJ/A8GDH7hSOYcTOt7e+KhS+RCf
 CtvTmOg1O2mPj10I7/ee0SDmGxE15TBR5Bf9JmdZwZP2CXBBKx8ptkoI8Xbrddk6DK
 KcTkt1KOP2L3g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Dw2476S05z6tmM;
 Tue,  9 Mar 2021 18:18:47 +0100 (CET)
From: haj@HIDDEN (Harald =?utf-8?Q?J=C3=B6rg?=)
To: 46889 <at> debbugs.gnu.org
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
In-Reply-To: <87im68uwld.fsf@hajtower> ("Harald
 \=\?utf-8\?Q\?J\=C3\=B6rg\=22's\?\= message of "Wed, 03
 Mar 2021 15:43:10 +0100")
References: <87im68uwld.fsf@hajtower>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Date: Tue, 09 Mar 2021 18:18:47 +0100
Message-ID: <877dmg9rew.fsf@hajtower>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 46889
Cc: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 Lars Ingebrigtsen <larsi@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: -3.3 (---)

Sorry, I accidently re-sent my initial report instead of this reply.

My patch has not been merged yet, and this is just as well: I'd like to
withdraw it and re-work parts of it.  This will take a day or two (or
more).  I also found that I've introduced a (minor) fontification bug.
-- 
Cheers, and sorry for the noise,
haj




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 9 Mar 2021 17:06:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 09 12:06:45 2021
Received: from localhost ([127.0.0.1]:47831 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lJfoj-000430-O8
	for submit <at> debbugs.gnu.org; Tue, 09 Mar 2021 12:06:45 -0500
Received: from mout01.posteo.de ([185.67.36.65]:50195)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <haj@HIDDEN>) id 1lJfog-00042l-Kd
 for 46889 <at> debbugs.gnu.org; Tue, 09 Mar 2021 12:06:45 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 279CD160061
 for <46889 <at> debbugs.gnu.org>; Tue,  9 Mar 2021 18:06:36 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017;
 t=1615309596; bh=DuA8elzW4J7Gp7L8L6mamtNuBx+QbByLNRTe1p61dtQ=;
 h=From:To:Subject:Date:From;
 b=TGq7qL4Je9XgdE8ZAmqA7bu7A2Rc/ScWA+cdAVaFoN32DoyFJENqZxCUgvVexDZ0U
 MhBlmfwS5n2q8LFYUo9/fUn5Ytinz+Z1wTO+LGet7e+iKYKBfCYyvKHrPt38N54wMn
 4ntAxgoy2b3TifTyD+QNbQJMuMnXOHosQfMpRH4biNITjfkqvvKAa1pm0/d+7ukyrh
 rRX4eSW5kg/33iHl4LFdAqE0XlfAX5971ZvVDYXJozjX+47s5HOa6/da9irpgh2tS5
 8/ZUSVPMdJEa95Ie7zC9R4/XwG0CMjqCyFI9JypMr8ZG5h/SukuLE5LJ18h2NCGsuO
 /VCaGgTqYRBMA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Dw1p3323Lz6tmS
 for <46889 <at> debbugs.gnu.org>; Tue,  9 Mar 2021 18:06:35 +0100 (CET)
From: haj@HIDDEN (Harald =?utf-8?Q?J=C3=B6rg?=)
To: 46889 <at> debbugs.gnu.org
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
In-Reply-To: <87im68uwld.fsf@hajtower> ("Harald
 \=\?utf-8\?Q\?J\=C3\=B6rg\=22's\?\= message of "Wed, 03
 Mar 2021 15:43:10 +0100")
References: <87im68uwld.fsf@hajtower>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Date: Tue, 09 Mar 2021 18:06:34 +0100
Message-ID: <87blbs9rz9.fsf@hajtower>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 46889
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: -3.3 (---)

haj@HIDDEN (Harald J=C3=B6rg) writes:

> Hello Emacs-Maintainers,
>
> this started out as working on Bug#42169 but it soon became clear that
> there's more lurking in CPerl mode's indentation code, so I decided to
> open a new issue here.
>
> In 7b2448ae (cperl-mode: Improve detection of index entries for imenu),
> committed on Feb 17, the imenu part of Bug#42169 has been fixed.  This
> commit now fixes the indentation after a package which brings its own
> block.
>
> Therefore, the patch in this report should finally fix Bug#42169.
>
> As a by-catch, the new code fixes the ancient Bug#8077.
>
> This patch also fixes the first part of Bug#11733.  The "other
> indentation bug" reported in Bug#11733 (using a colon as a Perl regexp
> terminator) is a different story and not covered by this patch.
>
> Also fixed now (without known bug number): labels with a space before,
> or a comment after the colon are now correctly indented and fontified.
>
> With this patch in effect, CPerl mode should finally have caught up with
> Perl 5.30!
>
> Many thanks to Mattias Engdeg=C3=A5rd for his patient explanations how rx
> expressions can be used without breaking compatibility to Emacs 26.1.
> Until now, this allowed two ugly regexp literals to be eliminated.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 5 Mar 2021 13:06:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 05 08:06:49 2021
Received: from localhost ([127.0.0.1]:33191 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lIAAK-0002Gm-Q4
	for submit <at> debbugs.gnu.org; Fri, 05 Mar 2021 08:06:48 -0500
Received: from quimby.gnus.org ([95.216.78.240]:34456)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lIAAJ-0002GZ-2W
 for 46889 <at> debbugs.gnu.org; Fri, 05 Mar 2021 08:06:47 -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=glHhFyDmZVVfAu+o/E2vGb9w7mJ1XbrFrNPc/ej/VbU=; b=kbRCMF0/Esk0XmDCLzpRIsqqfG
 4H7Y5J0X4Z0HfNAXnSI1qmHzA895hEcpcGOsoCD1Ij0Vr49yftD2bvwf+nZeCN42KmZ39MJFsRfLw
 +Mc74+JYypO1o5fmhVZiNJ7ELdnO9V1YOpvo08inMe4/GwK1vXLwdRqJReZQudwSEyX4=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lIAA7-0006Vs-AE; Fri, 05 Mar 2021 14:06:40 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stephen Berman <stephen.berman@HIDDEN>
Subject: Re: Help version guesser bug
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
 <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN>
 <87im66vl6q.fsf@HIDDEN> <87a6rh7v0x.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEX9+dr58sz+/ej1
 7cn+/vny7NH///9QINfkAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+UDBQ0BCZI8sMUAAADLSURBVDjL
 vZTRDYMwDESNu0BQF4iuniTyAO0H+69SO4HCh12JVuKIhMPLxQEjE5Wp0EFMDKA+LKzoqmDsmogQ
 qu6gbYGqrkAskGZTFX8mA7CtEF/lkvXeHIi2MW+6a4BNB9JwBPoPUM8hsYNCB0Aly5ECykBy3HoN
 QASQAXOUGCBx6Onk+ktpkeWgDLAmINkqy2HHjV9DvznOg6we4ARwBFpWWv9DOfq8cBBl7450q/C8
 3hlq/XSK3hfs6r3kdZ9nG0TL8qRl9CQbtzfH7gLyNmZrKgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAy
 MS0wMy0wNVQxMzowMTowOSswMDowMJgk+tgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDMtMDVU
 MTM6MDE6MDkrMDA6MDDpeUJkAAAAAElFTkSuQmCC
X-Now-Playing: Girls's _Reunion_: "Doggie Auto"
Date: Fri, 05 Mar 2021 14:06:33 +0100
In-Reply-To: <87a6rh7v0x.fsf@HIDDEN> (Stephen Berman's message of "Fri, 05 Mar
 2021 11:30:06 +0100")
Message-ID: <87sg59rbqe.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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: Stephen Berman <stephen.berman@HIDDEN> writes: > It's
 because
 help-fns--first-release finds this line in NEWS.27: > > ** Further functions
 and variables obsolete since Emacs 24 have been removed: Ah, I see. 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 Harald =?utf-8?Q?J=C3=B6rg?= <haj@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 (-)

Stephen Berman <stephen.berman@HIDDEN> writes:

> It's because help-fns--first-release finds this line in NEWS.27:
>
> ** Further functions and variables obsolete since Emacs 24 have been removed:

Ah, I see.

> On the assumption that in the NEWS files a first-level outline header
> contains the relevant reference to the first release and doesn't contain
> a reference to an earlier release, the following patch fixes the bug:

I've grepped through the NEWS files, and it looks like this assumption
is correct, so I've applied your patch.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 5 Mar 2021 10:30:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 05 05:30:25 2021
Received: from localhost ([127.0.0.1]:32942 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lI7iy-0002SJ-Pl
	for submit <at> debbugs.gnu.org; Fri, 05 Mar 2021 05:30:25 -0500
Received: from mout.gmx.net ([212.227.17.22]:41821)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stephen.berman@HIDDEN>) id 1lI7it-0002S0-Q5
 for 46889 <at> debbugs.gnu.org; Fri, 05 Mar 2021 05:30:23 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1614940209;
 bh=pXtbLdCg1MZUT9zy2SfUm0OW9rnDbcwFYAeqCxUqAXg=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date;
 b=cW0NzZ5oFXzuD8HUK2UnhnNC0BdKmYcUF9URU3U8xCU9EVuL7qDCbiEC/c2XjdB52
 mG3hiq1jZ5WyXbJ/wf0hwB9NPF8bRmMCl1js5ACiDCcBm+S/8XDQTta1czkweXsK3R
 nYMtLX4Ws319bi84sM1sKUitXCUmvpUplr+Xs15U=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from strobe-jhalfs ([188.109.206.74]) by mail.gmx.net (mrgmx104
 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mel81-1lsq7I0eKD-00apj7; Fri, 05
 Mar 2021 11:30:09 +0100
From: Stephen Berman <stephen.berman@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Help version guesser bug (was: bug#46889: cperl-mode: Fix
 indentation issues [PATCH])
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
 <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN>
 <87im66vl6q.fsf@HIDDEN>
Date: Fri, 05 Mar 2021 11:30:06 +0100
Message-ID: <87a6rh7v0x.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:f21mcv0whc27F3AKOAwAw+ALtYkrPF07nfx3MsnAZGi5vc8EeM/
 LFMPQBsl5XVTJY8mnTBJ/Vj4a4rCNgWMp3CIo2Yji+Qt1rO0jpYmS27aLH2hGc0gIGaSswi
 j7/w3KR2tNiCfr+zTnqLsOtvDuaIiTCHRXroUL5ihZjGHp5L0QKiRnFiVi4zmyOQabxFcpz
 OEH5LPLi6Y6c92YBCMBzQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:4RHrSnT9Phk=:+LG08hbJSTbudSkBlUu5Mi
 9QzAxFOfvfQX24+JNd6n0B70oOmChlrc53qqDubvabtiTCz5O2myz/Yc/LZkxevTvqBYZKCoX
 uwyhiBriaau5VPpv9fBVhPBxIc8I2LAQgsKTSBB6vui1+nDbPWzqc+QeSIF8RrsvmnX7OSabe
 pnIZemCuUo84aRMVI4xn4VqU4/YL+GhHOOxalQY8/JzZa8q0mLRPVpRZ+vQC+00NycFLPAo9u
 ERMwOUc6jL5coiLDDatpa/qJUL1V78R+hCEGrKE+NkMiSX97QcnvVizkq4gRrzqX95YDbaJsy
 +jMLIXQB9jWlMDR70jl07WIytewKypIlDSVDIno3y2gPWYFivqH8eKPfqhZ5N3XjtTMtnBY1p
 Juxa2O6m6SO/wKCBBakFtBTl5EX5SCFsu4Uz2TcgT6csjT0iJ9CZMSkm/1VXFacxR6HQbkKt4
 Y7qJvnOIKO3UCy2vG3ZwKnELCwgxOcJUte0SliFU9eywFkWKb1F91eTDaTgusIenLW0fvN7JB
 +zZdCEONnN4aJzVr1fFlEANQ1nm4Sy6A1/eHLi/gBN4fprNbVaRRbpHX6xloB1hLMO7bUqVFw
 I/224FsKdiv2ONgk+VXMlnNfWWZqwHOWtMs7tkqEprcjeH/JDhtSE8ebBynpJePIktaMpFaCQ
 6NOE+ILvFwga7U4BO+Pod/t3u9Lw/9JgbpUUHQP5Zj09sojwRBZk/jRf8zERu3u+o2NZjz8CG
 gw/oCVa2ajSZDptagUSQz+2FqDgKkfbPPOih9qra5oDiPRR8vI6WkIVi0xjZTBUvH//Kwtu7e
 2FqlNBwF9vuYPrL3qD9CU+j2tQo2MCmMK+i+7JcpQzr/cHVsPocRXA+obp5Y6uxLbla1VeQww
 Pl21v+kA1Ttwz8eO9kdA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>,
 Harald =?utf-8?Q?J=C3=B6rg?= <haj@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.7 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, 04 Mar 2021 19:16:29 +0100 Lars Ingebrigtsen <larsi@HIDDEN> wrote:

> Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> writes:
>
>> `rx-define` is new in Emacs 27, and the patch was apparently intended
>> to work with 26.1.
>
> I was fooled by the version guesser:
>
> ---
> rx-define is an autoloaded Lisp macro in =E2=80=98rx.el=E2=80=99.
>
> (rx-define NAME [(ARGS...)] RX)
>
>   Probably introduced at or before Emacs version 24.
> ---
>
> I wonder where that is coming from...  rx-define isn't mentioned in
> NEWS.24?

It's because help-fns--first-release finds this line in NEWS.27:

** Further functions and variables obsolete since Emacs 24 have been remove=
d:

On the assumption that in the NEWS files a first-level outline header
contains the relevant reference to the first release and doesn't contain
a reference to an earlier release, the following patch fixes the bug:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline
Content-Description: help-fns--first-release patch

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 290bebf7e5..01d3756bf0 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -668,7 +668,7 @@ help-fns--first-release
               ;; Almost all entries are of the form "* ... in Emacs NN.MM."
               ;; but there are also a few in the form "* Emacs NN.MM is a bug
               ;; fix release ...".
-              (if (not (re-search-backward "^\\*.* Emacs \\([0-9.]+[0-9]\\)"
+              (if (not (re-search-backward "^\\* .* Emacs \\([0-9.]+[0-9]\\)"
                                            nil t))
                   (message "Ref found in non-versioned section in %S"
                            (file-name-nondirectory f))

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable



Steve Berman

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 4 Mar 2021 18:34:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 04 13:34:46 2021
Received: from localhost ([127.0.0.1]:60193 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHso9-0004BY-Q8
	for submit <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:34:46 -0500
Received: from quimby.gnus.org ([95.216.78.240]:53066)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lHso8-0004BK-8g
 for 46889 <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:34:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=aXpSS8gKFP3Z31Z0Pq9/jbnrR6kIf1jlL2R6lxDFiko=; b=pPceD/IiSwrYdrqKApA+1PUvH/
 McRLYjBueTyEgRlxAKp9jOoVg5P0/qP4v4g15ujhMvkKU8ubP+77Xb1wtus0dPy5QEGqOg1UhPYQh
 e+R+zJcqcax6HhmJBx0Gu1G7dhGQuqBf+UlzxkJVtIljF6kdvfR32zaQWBZshNV8GhsQ=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lHsnt-0005kC-97; Thu, 04 Mar 2021 19:34:37 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
 <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN>
 <87im66vl6q.fsf@HIDDEN>
 <4590C9ED-BABA-4C8D-BEDB-482E1A2191AB@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXQtWGDckf68KD8
 +sz////a6xcNAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UDBBIiCYNTRIwAAAG7SURBVDjLfZMBdgMh
 CESRXAB7AhYu0If3v1tn0N2mfa81ycbwBcbRiMwp06aJiQx8SYzJIftrMoTnR65VmNjET75mf6ZV
 LAyfo4EZE7jsVaILSZfsAsLBjJQhEbkua2ARLt2MSkQ1L7aUqZ0xbHQqfqlzNtjm1MI6RW+TPebH
 Kr+bKfXGBgM6AGwYilDvOBmSzEDYlJLeQDADhazDlQ9AijvkWhK4Qt5WisJRTkBDLlbt9la5krrk
 VQBR84BXZa0kCEWHXGNqA2jBOk6KAKpg0um9ilOtyMjSy84OoTIIII6C4e0WJZp1QGAKUaYupwmG
 o0HgOHAFLG6gDfiQ4GFsEN0fNuGNAIEfSViMrazOaPt9x7Pai5bGW4HaLrQzdvwAWuht+Q9AXwe3
 0UrXA3gU0NfA74TtS4dOxg2Y06FqnyqeOHJQBgudu15vKbFBbVBP92JHgvaJbtyANnNpd6LZRJkt
 naAl8IrgrzHn+W/hdNaRC0vp0OB7DB7bDT75XH2MlPUNOnI6sPQNuJPvAYfiD3A79mv8B85N+AX0
 AXIXOGrPvQXmGtcTlzfAS6EbtKvnFvo+ZfZyfw5WvgDNymxegwiKwQAAACV0RVh0ZGF0ZTpjcmVh
 dGUAMjAyMS0wMy0wNFQxODozNDowOCswMDowMAg5chsAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEt
 MDMtMDRUMTg6MzQ6MDgrMDA6MDB5ZMqnAAAAAElFTkSuQmCC
X-Now-Playing: In The Nursery's _Twins_: "Profile 63"
Date: Thu, 04 Mar 2021 19:34:27 +0100
In-Reply-To: <4590C9ED-BABA-4C8D-BEDB-482E1A2191AB@HIDDEN> ("Mattias
 =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Thu, 4 Mar 2021 19:23:43
 +0100")
Message-ID: <87eeguvkcs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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:  Mattias Engdegård <mattiase@HIDDEN> writes: > I don't know.
    Is there a way to override the guesser and provide an > explicit version?
    > > Similarly, if an argument has been added or extended, wouldn't it be
   > useful to add this to the documenta [...] 
 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org, Harald =?utf-8?Q?J=C3=B6rg?= <haj@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 (-)

Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> writes:

> I don't know. Is there a way to override the guesser and provide an
> explicit version?
>
> Similarly, if an argument has been added or extended, wouldn't it be
> useful to add this to the documentation in some way?

Both are more work than we're willing to do.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 4 Mar 2021 18:23:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 04 13:23:52 2021
Received: from localhost ([127.0.0.1]:60182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHsdc-0003vD-GN
	for submit <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:23:52 -0500
Received: from mail151c50.megamailservers.eu ([91.136.10.161]:50214
 helo=mail50c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1lHsdX-0003v0-K5
 for 46889 <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:23:51 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1614882226;
 bh=UnzXyd4brnrd5Ef12C4AgL/8MHMPcMCNhz5+/sqAgbo=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=PTMI2CXAyUlLhv9HRPHoofWMCktGzSnsyiEQmPkIaEFp9un9E1Pd20M63rbCZ5AFk
 52z47GEz76ToYM1tPLNBnmrMh5/+WYz9jvh7bLocSxseLQ9QjyFE22sArEqcrWaGii
 /NhOg51IL4doaB9ATkmXHxmKoxi6I2EQIkxzJN+M=
Feedback-ID: mattiase@HIDDEN
Received: from stanniol.lan (c-b952e353.032-75-73746f71.bbcust.telenor.se
 [83.227.82.185]) (authenticated bits=0)
 by mail50c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 124INiKc024749; 
 Thu, 4 Mar 2021 18:23:45 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <87im66vl6q.fsf@HIDDEN>
Date: Thu, 4 Mar 2021 19:23:43 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <4590C9ED-BABA-4C8D-BEDB-482E1A2191AB@HIDDEN>
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
 <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN> <87im66vl6q.fsf@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A742F16.604125B2.0003, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=UMej4xXy c=1 sm=1 tr=0 a=von4qPfY+hyqc0zmWf0tYQ==:117
 a=von4qPfY+hyqc0zmWf0tYQ==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=OocQHUDgAAAA:8 a=eg5f43Egy2YiJZnnVVAA:9 a=CjuIK1q_8ugA:10
 a=xUZTl98r3Qw_uB5NK3jt:22
X-Origin-Country: SE
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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
 the administrator of that system for details.
 Content preview: 4 mars 2021 kl. 19.16 skrev Lars Ingebrigtsen
 <larsi@HIDDEN>:
 > I wonder where that is coming from... rx-define isn't mentioned in >
 NEWS.24?
 I don't know. Is there a way to override the guesser and provide an explicit
 version? 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.3 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org, =?utf-8?Q?Harald_J=C3=B6rg?= <haj@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: -0.0 (/)

4 mars 2021 kl. 19.16 skrev Lars Ingebrigtsen <larsi@HIDDEN>:

> I wonder where that is coming from...  rx-define isn't mentioned in
> NEWS.24?

I don't know. Is there a way to override the guesser and provide an =
explicit version?

Similarly, if an argument has been added or extended, wouldn't it be =
useful to add this to the documentation in some way?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 4 Mar 2021 18:19:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 04 13:19:51 2021
Received: from localhost ([127.0.0.1]:60172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHsZj-0003oj-KR
	for submit <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:19:51 -0500
Received: from mout02.posteo.de ([185.67.36.66]:35693)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <haj@HIDDEN>) id 1lHsZi-0003oV-1Q
 for 46889 <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:19:50 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 57E5A240100
 for <46889 <at> debbugs.gnu.org>; Thu,  4 Mar 2021 19:19:43 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017;
 t=1614881983; bh=0UobGKpbtFrShD8boWfknu4Lnvg9lTx/zLJfEAYHIPs=;
 h=From:To:Cc:Subject:Date:From;
 b=hSC5CnDAuKM4J/kL0wc31GM85rychZMKQnNtu311plxsYnE8dMRrF5RXbVg/NAKPL
 XXzvDo92Y+DMi09Yc+jTFWlXJTNau87yQCG1QSSgK1U6e7P1VSeQo9am8NRDiauC58
 ko4TI+YQUu7FYYEKT7z/CFumgP4GI/uRxN+IMVLJiWRYt9bsDRU57VNVvt8CcZb6Y5
 gK2mvSDiKT+FT44+qYq5WFbgaA1vh4JUVzzLK2rWKpRnV4cfm4F7IbfCEI1zpaebL4
 q61ChOEbTs+/OoWyu26Z5hGPXDo9bIK0STJCjP7Td4fbRVJK0eKSD6097sB1HX4mcI
 PME1YtP+cZdnA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Drzfk3XX6z9rxW;
 Thu,  4 Mar 2021 19:19:42 +0100 (CET)
From: haj@HIDDEN (Harald =?utf-8?Q?J=C3=B6rg?=)
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
In-Reply-To: <87tupqvn9i.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 04 Mar 2021 18:31:37 +0100")
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Date: Thu, 04 Mar 2021 19:19:42 +0100
Message-ID: <87ft1au6gx.fsf@hajtower>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@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: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> [...]
>> Many thanks to Mattias Engdeg=C3=A5rd for his patient explanations how rx
>> expressions can be used without breaking compatibility to Emacs 26.1.
>> Until now, this allowed two ugly regexp literals to be eliminated.
>
> Funnily enough, that's the one thing I was going to ask you about with
> this patch.
>
> I'm not an experienced rx user -- at all -- but is this the best way to
> do this?
>
>> +(eval-and-compile
>> +  (defconst cperl--ws-rx
>> +    '(sequence (or space "\n"))
>
> It was the eval-and-compile that made me look at this bit...

I am not an experienced rx user at all, I only recently discovered it :)
I'm always happy when somebody else is looking over my changes.

The patch was a result of a my understanding of an off-the-lists dialog
between Mattias and me, where it is totally possible that I
misunderstood or misimplemented things.

What led me to eval-and-compile was that I want to "compose" Perl syntax
elements from those defined earlier - and I also want to write unit
tests for the rx form in cperl-mode-tests.el.

> [...]
>
>> +(defconst cperl-maybe-white-and-comment-rex
>> +  (rx-to-string `(group (eval cperl--ws*-rx)))
>
> I'm thinking of the rx `eval' things everywhere.  Wouldn't defining
> these rx expressions with `rx-define' be more straighforward, and then
> you'd have:

Yes, it would be.  The downside is that I'd have to abandon the plan to
move CPerl mode to ELPA and make it available for Emacs 26.1 and up.
Perl coders might want to try the new CPerl mode without having to build
Emacs 28 - and I want their feedback.

I'm ready to upgrade that stuff to `rx-define' when the typical Linux
distributions ship with an Emacs version supporting it!

>> +(defconst cperl-maybe-white-and-comment-rex
>> +  (rx-to-string `(group cperl--ws*-rx))
>
> (Similarly for basically all the rx `eval' bits.
>
> Now, rx expands the `eval' at compile time, I think, so it doesn't
> really make that much difference in practice, but it seems slightly
> clearer, perhaps?

Sure, I understand that.

By the way, the journey isn't over yet.  What I plan to do next is to
add support for popular Perl extensions which bring new syntax (also, a
new Perl version might sooner or later bring the same keywords, probably
with "better" syntax).  So I guess there will be a basic
compile-time-syntax, plus modifications at runtime when I know which
exact syntax applies to a buffer.
--=20
Cheers,
haj




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 4 Mar 2021 18:16:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 04 13:16:42 2021
Received: from localhost ([127.0.0.1]:60167 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHsWg-0003kL-6I
	for submit <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:16:42 -0500
Received: from quimby.gnus.org ([95.216.78.240]:52954)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lHsWe-0003k9-Ma
 for 46889 <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:16:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=fGkL4Neu4cgRh3VGgpTCNp23EfikIiHi7hDwThUEtqs=; b=FIHWAg6/IxE7nzYeCEGyH1uFVJ
 EXO//NGmygnSvC2bhmWAY+kSas/C39xj+rYJYXfJ9qUfu4blB+wvWxEk4wZZXfBZQmPaTaZFD8skl
 n1pqdKxwgS1rhm2Pk67gvoja/+mwT1rGtkge1n9eyNyYTZ8NDcpv4LhtZWVjQ1rsEBFk=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lHsWU-0005bn-Pl; Thu, 04 Mar 2021 19:16:34 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
 <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAM1BMVEU5MJBDOZQxJ4ou
 JYklG4ZbU6IkHW7+/v7v2dytocepfaXx5+vISGD0JCzzGCHwKjL///+CKEnfAAAAAWJLR0QQlbIN
 LAAAAAd0SU1FB+UDBBIOLPFm+2UAAAF/SURBVEjHvZTploMgDEYji2w6vv/bDmENEOzMn349VY+9
 NwSUAsQcmHTO1yCEkGKK0hDvnRHQGqF01AIvtGCitLGxyhlLQiyIR7yMNcppitTOOQ/yBBmT7qSI
 /BGc4L0/UOj3kiU2Ud4EwJYakdhuSJVDJnEonHQnJDleF2DTzmup6oopPJ3QF1CWIH//XCbH6t5m
 WlZZijY+5rqfpxnGHb0v0VcJvc7fNzHCIekIch7hulOoAa1mFnLjtP5kOLUIpJ8WYmg1tFRHEANP
 DSuHSZdnNvPUqPMehIUnhlbDspbvwnfDjQLbz2CMQlZYvhqMsOGL4aeWdjw+w/Re6WmV9vXLGJDX
 BV9v3Mziej7kghwBAWNt+JAKWKjP3rym/RyqEF4NGxbh1eg8EV4MwlNha1B+EDbGwI8Ca4z8JDDG
 xBszCoux8LMwGSu/CIPB8KtADI5nhGawPCcUg+dZIRkbnhcMbhDzH8GEHb8T9vmC0Lb3tmv6XxAF
 62r+IHxlDr8kbjx/PFZIUQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wMy0wNFQxODoxNDo0NCsw
 MDowMBO/r1QAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDMtMDRUMTg6MTQ6NDQrMDA6MDBi4hfo
 AAAAAElFTkSuQmCC
X-Now-Playing: Islet's _Fire Comp 2020_: "Geese (Gwenno Remix)"
Date: Thu, 04 Mar 2021 19:16:29 +0100
In-Reply-To: <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN> ("Mattias
 =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Thu, 4 Mar 2021 19:07:28
 +0100")
Message-ID: <87im66vl6q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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:  Mattias Engdegård <mattiase@HIDDEN> writes: > `rx-define`
    is new in Emacs 27, and the patch was apparently intended > to work with
   26.1. I was fooled by the version guesser: 
 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org, Harald =?utf-8?Q?J=C3=B6rg?= <haj@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 (-)

Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> writes:

> `rx-define` is new in Emacs 27, and the patch was apparently intended
> to work with 26.1.

I was fooled by the version guesser:

---
rx-define is an autoloaded Lisp macro in =E2=80=98rx.el=E2=80=99.

(rx-define NAME [(ARGS...)] RX)

  Probably introduced at or before Emacs version 24.
---

I wonder where that is coming from...  rx-define isn't mentioned in
NEWS.24?

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 4 Mar 2021 18:07:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 04 13:07:39 2021
Received: from localhost ([127.0.0.1]:60160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHsNv-0003Xa-5S
	for submit <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:07:39 -0500
Received: from mail226c50.megamailservers.eu ([91.136.10.236]:43732
 helo=mail36c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1lHsNp-0003XN-72
 for 46889 <at> debbugs.gnu.org; Thu, 04 Mar 2021 13:07:38 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1614881251;
 bh=+4Uf6MrXv2tmreLhwLCHNEzX/UEzIAzQPglOtbZtDm0=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=F3iVwLdSeRSEyt/cpHCmV6eV3WMxHT9erjJrhvFakW2QgfiXJ6GwPpGa7j/a5aTqV
 qFHd1rZa1OlMkbu37qfmwk32wCERUkQpVNH/Yy2n/q2atA7GfngF+N13HpsuE6EVnN
 rTK5ckRIj6hbqKMTIl5OkX4Hxx+MSnY+Vqivz32M=
Feedback-ID: mattiase@HIDDEN
Received: from stanniol.lan (c-b952e353.032-75-73746f71.bbcust.telenor.se
 [83.227.82.185]) (authenticated bits=0)
 by mail36c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 124I7Te1012574; 
 Thu, 4 Mar 2021 18:07:30 +0000
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\))
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <87tupqvn9i.fsf@HIDDEN>
Date: Thu, 4 Mar 2021 19:07:28 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <726A49CD-3D7F-44A3-A09F-F5C32F22EB28@HIDDEN>
References: <87im68uwld.fsf@hajtower> <87tupqvn9i.fsf@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
X-Mailer: Apple Mail (2.3445.104.17)
X-CTCH-RefID: str=0001.0A742F1A.604121E3.0054, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-CSC: 0
X-CHA: v=2.3 cv=M4oz1B4s c=1 sm=1 tr=0 a=von4qPfY+hyqc0zmWf0tYQ==:117
 a=von4qPfY+hyqc0zmWf0tYQ==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10
 a=OocQHUDgAAAA:8 a=6vf2Kgs8V_9uYtELBEoA:9 a=CjuIK1q_8ugA:10
 a=xUZTl98r3Qw_uB5NK3jt:22
X-Origin-Country: SE
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.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
 the administrator of that system for details.
 Content preview: 4 mars 2021 kl. 18.31 skrev Lars Ingebrigtsen
 <larsi@HIDDEN>:
 > I'm thinking of the rx `eval' things everywhere. Wouldn't defining > these
 rx expressions with `rx-define' be more straighforward, and then > you'd
 have: Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.3 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org, =?utf-8?Q?Harald_J=C3=B6rg?= <haj@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: -0.0 (/)

4 mars 2021 kl. 18.31 skrev Lars Ingebrigtsen <larsi@HIDDEN>:

> I'm thinking of the rx `eval' things everywhere.  Wouldn't defining
> these rx expressions with `rx-define' be more straighforward, and then
> you'd have:

`rx-define` is new in Emacs 27, and the patch was apparently intended to =
work with 26.1.

>> +(defconst cperl-maybe-white-and-comment-rex
>> +  (rx-to-string `(group cperl--ws*-rx))
>=20
> (Similarly for basically all the rx `eval' bits.
>=20
> Now, rx expands the `eval' at compile time, I think, so it doesn't
> really make that much difference in practice, but it seems slightly
> clearer, perhaps?

Even in Emacs 26, there are several more or less equivalent ways of =
expressing the same thing. I'm sure it will be fine.

A minor detail -- ignore it if you like -- is that some backquote forms =
now no longer have any substitutions (, or ,@) and could therefore be =
plain quoted forms. Or, if you prefer, you could keep the backquotes and =
use comma-substitution instead of `eval` instead of mixing the two. It =
may also be a good idea to use `rx` instead of `rx-to-string` in some =
places to ensure that the translation is done at compile time instead of =
when the module is loaded.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at 46889 <at> debbugs.gnu.org:


Received: (at 46889) by debbugs.gnu.org; 4 Mar 2021 17:31:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 04 12:31:54 2021
Received: from localhost ([127.0.0.1]:60083 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHrpK-0002dY-LD
	for submit <at> debbugs.gnu.org; Thu, 04 Mar 2021 12:31:54 -0500
Received: from quimby.gnus.org ([95.216.78.240]:52622)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1lHrpH-0002dJ-Go
 for 46889 <at> debbugs.gnu.org; Thu, 04 Mar 2021 12:31:52 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=kI86Mg/gqgmvamy3Y/k5Y9TVHUbYK9M7QaG0B6wIdqE=; b=WCuQIM+3x3icVWq9ekVv1hiato
 LdQgJOTaGYPb8xM3JcERQLoYsOfoAYmoJTXpJQbtXiNQZn8jCSLQU2BywMZ3SIV3eRZ2LeEQ50hb8
 WKrSR1k5CyUount6xLTyIGiyxp10r+helILC78R7wS4qj4Qd2S5fdrdUwmUIBPeh/xIo=;
Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1lHrp5-0005Fm-3h; Thu, 04 Mar 2021 18:31:44 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: haj@HIDDEN (Harald =?utf-8?Q?J=C3=B6rg?=)
Subject: Re: bug#46889: cperl-mode: Fix indentation issues [PATCH]
References: <87im68uwld.fsf@hajtower>
X-Now-Playing: Virginia Wing's _Fire Comp 2020_: "I'm Holding Out For
 Something"
Date: Thu, 04 Mar 2021 18:31:37 +0100
In-Reply-To: <87im68uwld.fsf@hajtower> ("Harald =?utf-8?Q?J=C3=B6rg=22's?=
 message of "Wed, 03 Mar 2021 15:43:10 +0100")
Message-ID: <87tupqvn9i.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
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:  haj@HIDDEN (Harald Jörg) writes: > As a by-catch, the
   new code fixes the ancient Bug#8077. > > This patch also fixes the first part
    of Bug#11733. The "other > indentation bug" reported in Bug#11733 (using
   a colon as a Perl regexp > t [...] 
 
 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: 0.0 (/)
X-Debbugs-Envelope-To: 46889
Cc: 46889 <at> debbugs.gnu.org,
 Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@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 (-)

haj@HIDDEN (Harald J=C3=B6rg) writes:

> As a by-catch, the new code fixes the ancient Bug#8077.
>
> This patch also fixes the first part of Bug#11733.  The "other
> indentation bug" reported in Bug#11733 (using a colon as a Perl regexp
> terminator) is a different story and not covered by this patch.
>
> Also fixed now (without known bug number): labels with a space before,
> or a comment after the colon are now correctly indented and fontified.

Sounds good.

> With this patch in effect, CPerl mode should finally have caught up with
> Perl 5.30!

:-)

> Many thanks to Mattias Engdeg=C3=A5rd for his patient explanations how rx
> expressions can be used without breaking compatibility to Emacs 26.1.
> Until now, this allowed two ugly regexp literals to be eliminated.

Funnily enough, that's the one thing I was going to ask you about with
this patch.

I'm not an experienced rx user -- at all -- but is this the best way to
do this?

> +(eval-and-compile
> +  (defconst cperl--ws-rx
> +    '(sequence (or space "\n"))

It was the eval-and-compile that made me look at this bit...

[...]

> +(defconst cperl-maybe-white-and-comment-rex
> +  (rx-to-string `(group (eval cperl--ws*-rx)))

I'm thinking of the rx `eval' things everywhere.  Wouldn't defining
these rx expressions with `rx-define' be more straighforward, and then
you'd have:

> +(defconst cperl-maybe-white-and-comment-rex
> +  (rx-to-string `(group cperl--ws*-rx))

(Similarly for basically all the rx `eval' bits.

Now, rx expands the `eval' at compile time, I think, so it doesn't
really make that much difference in practice, but it seems slightly
clearer, perhaps?

(Added Mattias to the CCs.)

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Mar 2021 14:43:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 03 09:43:26 2021
Received: from localhost ([127.0.0.1]:55474 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lHSij-0005sp-GH
	for submit <at> debbugs.gnu.org; Wed, 03 Mar 2021 09:43:26 -0500
Received: from lists.gnu.org ([209.51.188.17]:52720)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <haj@HIDDEN>) id 1lHSih-0005sf-86
 for submit <at> debbugs.gnu.org; Wed, 03 Mar 2021 09:43:24 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:39978)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <haj@HIDDEN>) id 1lHSih-0005Vz-0z
 for bug-gnu-emacs@HIDDEN; Wed, 03 Mar 2021 09:43:23 -0500
Received: from mout02.posteo.de ([185.67.36.66]:41413)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <haj@HIDDEN>) id 1lHSiZ-0001BJ-2D
 for bug-gnu-emacs@HIDDEN; Wed, 03 Mar 2021 09:43:22 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id D861C240100
 for <bug-gnu-emacs@HIDDEN>; Wed,  3 Mar 2021 15:43:11 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017;
 t=1614782591; bh=5TL0+U3ra8aIaV+Nvv1Re4k/FZE6KLWBsP6COKZllA4=;
 h=From:To:Subject:Date:From;
 b=ZvtLOOvkY3rVreOsj/Iokq8m0GerO5UlRe/KBiN1qESTyYkSa6oIcpasW5NcEhhQz
 7Dp7bBuKE5N13K60sd7vQQcO/HrsHivZHhE2PV7df9ee/mfuINWUP//pAP7dbB1+1/
 p0sMqmJVo4tPh8CMdC6uTbXn3iHeAiRCNn4hWsmhVuQWjaTv8LzarfGvdMXiK04Ykn
 bEyINVoQ0mQ3FzWSPb/AbqIvOfUBV3kJvxBTf8s6m2bNnvETC4TSyIVE58HLMqau84
 fasytoyBsEr6Ls92MnV/B16PivyUhNC4lu1OmDKjJB12i1mCj/lzwnER5pCyzBZ6cG
 6e6UjOhploAgg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4DrGvM0pr3z9rxM
 for <bug-gnu-emacs@HIDDEN>; Wed,  3 Mar 2021 15:43:10 +0100 (CET)
From: haj@HIDDEN (Harald =?utf-8?Q?J=C3=B6rg?=)
To: bug-gnu-emacs@HIDDEN
Subject: cperl-mode: Fix indentation issues [PATCH]
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Date: Wed, 03 Mar 2021 15:43:10 +0100
Message-ID: <87im68uwld.fsf@hajtower>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.66; envelope-from=haj@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 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,
 RCVD_IN_DNSWL_MED=-2.3, 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-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
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: -2.3 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello Emacs-Maintainers,

this started out as working on Bug#42169 but it soon became clear that
there's more lurking in CPerl mode's indentation code, so I decided to
open a new issue here.

In 7b2448ae (cperl-mode: Improve detection of index entries for imenu),
committed on Feb 17, the imenu part of Bug#42169 has been fixed.  This
commit now fixes the indentation after a package which brings its own
block.

Therefore, the patch in this report should finally fix Bug#42169.

As a by-catch, the new code fixes the ancient Bug#8077.

This patch also fixes the first part of Bug#11733.  The "other
indentation bug" reported in Bug#11733 (using a colon as a Perl regexp
terminator) is a different story and not covered by this patch.

Also fixed now (without known bug number): labels with a space before,
or a comment after the colon are now correctly indented and fontified.

With this patch in effect, CPerl mode should finally have caught up with
Perl 5.30!

Many thanks to Mattias Engdeg=C3=A5rd for his patient explanations how rx
expressions can be used without breaking compatibility to Emacs 26.1.
Until now, this allowed two ugly regexp literals to be eliminated.
--=20
Cheers,
haj

--=-=-=
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
 filename=0001-cperl-mode-fix-indentation-issues.patch
Content-Transfer-Encoding: quoted-printable
Content-Description: cperl-mode: Fix indentation issues

From 792f23db44a04db179921e72b11634e03d04ebb0 Mon Sep 17 00:00:00 2001
From: =3D?UTF-8?q?Harald=3D20J=3DC3=3DB6rg?=3D <haj@HIDDEN>
Date: Wed, 3 Mar 2021 14:07:44 +0100
Subject: [PATCH] ; cperl-mode: fix indentation issues
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit

* lisp/progmodes/cperl-mode.el (cperl-core-named-block-keywords),
(cperl-bare-block-keywords): New variables to allow adding new
keywords without mangling regular expressions..
(cperl--label-rx),
(cperl--false-label-rx) and more: String regexps are replaced
by rx forms, errors reported by relint are fixed. (thanks
Mattias Engdeg=C3=A5rd!)
(cperl-block-declaration-p): New function to replace several
inconsistent regexps.
(cperl-beginning-of-defun): New function to capture lexical
subs and functions where the opening brace is on a line of its
own (or even separated by attributes, signatures etc.)
(cperl-maybe-white-and-comment-rex),
(cperl-white-and-comment-rex): Now implemented in terms of
rx-forms.
(cperl-after-sub-regexp): Deleted, no more used.
(cperl-imenu--function-name-regexp-perl): Deleted, no more used.
(cperl-indent-line): Use the new rx-forms.
(cperl-sniff-for-indent): Use the new rx-formxs.
(cperl-after-block-p): Use the new keyword lists.
(cperl-init-faces): Replace literal regexps by rx forms.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-indent-region): New indentation test for lexical
subroutines and packages with version and/or blocks.
(cperl-test-ws+-rx): Test the rx S-expression instead of the
string regexp.

* test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl:
New testcases for indenting labels and "new style" packages.

* test/lisp/progmodes/cperl-mode-resources/cperl-indent-region.pl:
New file for indentation tests spanning more than one expression.
---
 lisp/progmodes/cperl-mode.el                  | 396 ++++++++++--------
 .../cperl-mode-resources/cperl-indent-exp.pl  |  76 ++++
 .../cperl-indent-region.pl                    | 118 ++++++
 test/lisp/progmodes/cperl-mode-tests.el       |  14 +-
 4 files changed, 430 insertions(+), 174 deletions(-)
 create mode 100644 test/lisp/progmodes/cperl-mode-resources/cperl-indent-r=
egion.pl

diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6b22228397..d2788da625 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1212,73 +1212,98 @@ cperl-menu
 ;; minimalistic Perl grammar, to be used instead of individual (and
 ;; not always consistent) literal regular expressions.
=20
-(defconst cperl--basic-identifier-regexp
-  (rx (sequence (or alpha "_") (* (or word "_"))))
-  "A regular expression for the name of a \"basic\" Perl variable.
+;; Perl Keyword sets
+;; These might be extended by extension modules or future Perl
+;; versions.  Therefore it should be possible to change the values
+;; at runtime, or even: for one CPerl mode buffer.
+(defconst cperl-core-named-block-keywords
+  '("BEGIN" "CHECK" "END" "INIT" "UNITCHECK"
+    ;; These two _should_ be following a sub statement, but are
+    ;; actually valid Perl without.
+    "DESTROY" "AUTOLOAD")
+  "These keywords introduce a block which ends a statement
+   without 'sub', and without a semicolon.  This affects
+   indentation.")
+
+(defconst cperl-bare-block-keywords
+  (append cperl-core-named-block-keywords
+          '("else"
+            ;; FIXME: The next keywords have been taken over from
+            ;; history.  Do they really belong here? - haj 2021-02-25
+            "grep" "map"
+            ;; FIXME: The following keywords are not Perl core
+            ;; and there are subtle syntactical differences between
+            ;; different extensions providing them - haj 2021-02-25
+            "try" "catch" "continue"))
+  "Keywords which are directly followed by a block.")
+
+(eval-and-compile
+  (defconst cperl--ws-rx
+    '(sequence (or space "\n"))
+    "Regular expression for a single whitespace in Perl.")
+
+  (defconst cperl--eol-comment-rx
+    '(sequence "#" (0+ (not (in "\n"))) "\n")
+    "Regular expression for a single end-of-line comment in Perl")
+
+  (defconst cperl--ws-or-comment-rx
+    '(or (eval cperl--ws-rx)
+         (eval cperl--eol-comment-rx))
+    "A regular expression for either whitespace or comment")
+
+  (defconst cperl--ws*-rx
+    '(0+ (eval cperl--ws-or-comment-rx))
+    "Regular expression for optional whitespaces or comments in Perl")
+
+  (defconst cperl--ws+-rx
+    '(1+ (eval cperl--ws-or-comment-rx))
+    "Regular expression for a sequence of whitespace and comments in Perl.=
")
+
+  (defconst cperl--basic-identifier-rx
+    '(sequence (or alpha "_") (* (or word "_")))
+    "A regular expression for the name of a \"basic\" Perl variable.
 Neither namespace separators nor sigils are included.  As is,
 this regular expression applies to labels,subroutine calls where
 the ampersand sigil is not required, and names of subroutine
 attributes.")
=20
-(defconst cperl--label-regexp
-  (rx-to-string
-   `(sequence
-     symbol-start
-     (regexp ,cperl--basic-identifier-regexp)
-     (0+ space)
-     ":"))
-  "A regular expression for a Perl label.
+  (defconst cperl--label-rx
+    '(sequence symbol-start
+               (eval cperl--basic-identifier-rx)
+               (0+ space)
+               ":")
+    "A regular expression for a Perl label.
 By convention, labels are uppercase alphabetics, but this isn't
 enforced.")
=20
-(defconst cperl--normal-identifier-regexp
-  (rx-to-string
-   `(or
-     (sequence
-      (1+ (sequence
-           (opt (regexp ,cperl--basic-identifier-regexp))
-           "::"))
-      (opt (regexp ,cperl--basic-identifier-regexp)))
-     (regexp ,cperl--basic-identifier-regexp)))
-  "A regular expression for a Perl variable name with optional namespace.
+  (defconst cperl--false-label-rx
+    '(sequence (or (in "sym") "tr") (0+ space) ":")
+    "A regular expression which is similar to a label, but might as
+  well be a quote-like operator with a colon as delimiter.")
+
+  (defconst cperl--normal-identifier-rx
+    '(or (sequence (1+ (sequence
+                        (opt (eval cperl--basic-identifier-rx))
+                        "::"))
+                   (opt (eval cperl--basic-identifier-rx)))
+         (eval cperl--basic-identifier-rx))
+    "A regular expression for a Perl variable name with optional namespace.
 Examples are `foo`, `Some::Module::VERSION`, and `::` (yes, that
 is a legal variable name).")
=20
-(defconst cperl--special-identifier-regexp
-  (rx-to-string
-   `(or
-     (1+ digit)                          ; $0, $1, $2, ...
-     (sequence "^" (any "A-Z" "]^_?\\")) ; $^V
-     (sequence "{" (0+ space)            ; ${^MATCH}
-               "^" (any "A-Z" "]^_?\\")
-               (0+ (any "A-Z" "_" digit))
-               (0+ space) "}")
-     (in "!\"$%&'()+,-./:;<=3D>?@\\]^_`|~")))   ; $., $|, $", ... but not =
$^ or ${
-  "The list of Perl \"punctuation\" variables, as listed in perlvar.")
-
-(defconst cperl--ws-regexp
-  (rx-to-string
-   '(or space "\n"))
-  "Regular expression for a single whitespace in Perl.")
-
-(defconst cperl--eol-comment-regexp
-  (rx-to-string
-   '(sequence "#" (0+ (not (in "\n"))) "\n"))
-  "Regular expression for a single end-of-line comment in Perl")
-
-(defconst cperl--ws-or-comment-regexp
-  (rx-to-string
-   `(1+
-     (or
-      (regexp ,cperl--ws-regexp)
-      (regexp ,cperl--eol-comment-regexp))))
-  "Regular expression for a sequence of whitespace and comments in Perl.")
-
-(defconst cperl--ows-regexp
-  (rx-to-string
-   `(opt (regexp ,cperl--ws-or-comment-regexp)))
-  "Regular expression for optional whitespaces or comments in Perl")
-
+  (defconst cperl--special-identifier-rx
+    '(or
+      (1+ digit)                          ; $0, $1, $2, ...
+      (sequence "^" (any "A-Z" "]^_?\\")) ; $^V
+      (sequence "{" (0+ space)            ; ${^MATCH}
+                "^" (any "A-Z" "]^_?\\")
+                (0+ (any "A-Z" "_" digit))
+                (0+ space) "}")
+      (in "!\"$%&'()+,-./:;<=3D>?@\\]^_`|~"))   ; $., $|, $", ... but not =
$^ or ${
+    "The list of Perl \"punctuation\" variables, as listed in perlvar."))
+
+;; This is left as a string regexp.  There are many version schemes in
+;; the wild, so people might want to fiddle with this variable.
 (defconst cperl--version-regexp
   (rx-to-string
    `(or
@@ -1296,11 +1321,11 @@ cperl--package-regexp
    `(sequence
      "package" ; FIXME: the "class" and "role" keywords need to be
                ; recognized soon...ish.
-     (regexp ,cperl--ws-or-comment-regexp)
-     (group (regexp ,cperl--normal-identifier-regexp))
+     (eval cperl--ws+-rx)
+     (group (eval cperl--normal-identifier-rx))
      (opt
       (sequence
-       (regexp ,cperl--ws-or-comment-regexp)
+       (eval cperl--ws+-rx)
        (group (regexp ,cperl--version-regexp))))))
   "A regular expression for package NAME VERSION in Perl.
 Contains two groups for the package name and version.")
@@ -1309,7 +1334,7 @@ cperl--package-for-imenu-regexp
   (rx-to-string
    `(sequence
      (regexp ,cperl--package-regexp)
-     (regexp ,cperl--ows-regexp)
+     (eval cperl--ws*-rx)
      (group (or ";" "{"))))
   "A regular expression to collect package names for `imenu`.
 Catches \"package NAME;\", \"package NAME VERSION;\", \"package
@@ -1321,19 +1346,28 @@ cperl--sub-name-regexp
   (rx-to-string
    `(sequence
      (optional (sequence (group (or "my" "state" "our"))
-			 (regexp ,cperl--ws-or-comment-regexp)))
+			 (eval cperl--ws+-rx)))
      "sub" ; FIXME: the "method" and maybe "fun" keywords need to be
            ; recognized soon...ish.
-     (regexp ,cperl--ws-or-comment-regexp)
-     (group (regexp ,cperl--normal-identifier-regexp))))
+     (eval cperl--ws+-rx)
+     (group (eval cperl--normal-identifier-rx))))
   "A regular expression to detect a subroutine start.
 Contains two groups: One for to distinguish lexical from
 \"normal\" subroutines and one for the subroutine name.")
=20
-(defconst cperl--pod-heading-regexp
+(defconst cperl--block-declaration-regexp
   (rx-to-string
    `(sequence
-     line-start "=3Dhead"
+     (or "package" "sub")  ; "class" and "method" coming soon
+     (1+ (eval cperl--ws-or-comment-rx))
+     (eval cperl--normal-identifier-rx)))
+  "A regular expression to find a declaration for a named block.
+Used for indentation.  These declarations introduce a block which
+does not need a semicolon to terminate the statement.")
+
+(defconst cperl--pod-heading-regexp
+  (rx-to-string
+   `(sequence line-start "=3Dhead"
      (group (in "1-4"))
      (1+ (in " \t"))
      (group (1+ (not (in "\n"))))
@@ -1346,61 +1380,84 @@ cperl--imenu-entries-regexp
   (rx-to-string
    `(or
      (regexp ,cperl--package-for-imenu-regexp) ; 1..3
-     (regexp ,cperl--sub-name-regexp)	       ; 4..5
+     (regexp ,cperl--sub-name-regexp)          ; 4..5
      (regexp ,cperl--pod-heading-regexp)))     ; 6..7
   "A regular expression to collect stuff that goes into the `imenu` index.
 Covers packages, subroutines, and POD headings.")
=20
 
+(defun cperl-block-declaration-p ()
+  "Tests whether the following ?\\{ opens a declaration block.
+Returns the column where the declarating keyword is found, or nil
+if this isn't a declaration block.  Declaration blocks are named
+subroutines, packages and the like.  They start with a keyword
+and a name, to be followed by various descriptive items which are
+just skipped over for our purpose."
+  ;; A scan error means that none of the declarators has been found
+  (condition-case nil
+      (let ((is-block-declaration nil)
+            (continue-searching t))
+        (while (and continue-searching (not (bobp)))
+          (forward-sexp -1)
+          (cond
+           ((looking-at cperl--block-declaration-regexp)
+            (setq is-block-declaration (current-column)
+                  continue-searching nil))
+           ;; Another brace means this is no block declaration
+           ((looking-at "{")
+            (setq continue-searching nil))
+           (t
+            (cperl-backward-to-noncomment (point-min))
+            ;; A semicolon or an opening brace prevent this block from
+            ;; being a block declaration
+            (when (or (eq (preceding-char) ?\;)
+                      (eq (preceding-char) ?{))
+              (setq continue-searching nil)))))
+        is-block-declaration)
+    (error nil)))
+
+(defun cperl-beginning-of-defun (&optional arg)
+  "Move backward to the beginning of a subroutine or package ARG times.
+If point is within a function, then go to the line where its
+definition starts.  If point is outside of a function but within
+a package, go to the first line of the package.  Returns t if the
+search succeeded.  If there's neither a package nor a subroutine
+around point, leaves point undhanged and returns nil.  This
+function ignores `open-paren-in-column-0-is-defun-start',
+and also ignores ARG.
+
+This is the substitute for `beginning-of-defun-raw', so it does
+not jump to the beginning of the line where the target was
+found."
+  (interactive "^p")
+  (unless arg (setq arg 1))
+  (let ((state (syntax-ppss (point))))
+    (catch 'done
+      (dolist (paren-pos (reverse (nth 9 state)))
+        (when (char-equal (char-after paren-pos) ?{)
+          (goto-char paren-pos)
+          (when (cperl-block-declaration-p)
+            (throw 'done t))))
+      (re-search-backward
+       (rx-to-string `(sequence line-start
+                                (regexp ,cperl--package-regexp)))
+       nil 'move))))
+
+
 ;; These two must be unwound, otherwise take exponential time
-(defconst cperl-maybe-white-and-comment-rex "[ \t\n]*\\(#[^\n]*\n[ \t\n]*\=
\)*"
+(defconst cperl-maybe-white-and-comment-rex
+  (rx-to-string `(group (eval cperl--ws*-rx)))
+  ;; was: "[ \t\n]*\\(#[^\n]*\n[ \t\n]*\\)*"
 "Regular expression to match optional whitespace with interspersed comment=
s.
 Should contain exactly one group.")
=20
 ;; This one is tricky to unwind; still very inefficient...
-(defconst cperl-white-and-comment-rex "\\([ \t\n]\\|#[^\n]*\n\\)+"
+(defconst cperl-white-and-comment-rex
+  (rx-to-string `(group (eval cperl--ws+-rx)))
+  ;; was: "\\([ \t\n]\\|#[^\n]*\n\\)+"
 "Regular expression to match whitespace with interspersed comments.
 Should contain exactly one group.")
=20
-
-;; Is incorporated in `cperl-outline-regexp', `defun-prompt-regexp'.
-;; Details of groups in this may be used in several functions; see comments
-;; near mentioned above variable(s)...
-;; sub($$):lvalue{}  sub:lvalue{} Both allowed...
-(defsubst cperl-after-sub-regexp (named attr) ; 9 groups without attr...
-  "Match the text after `sub' in a subroutine declaration.
-If NAMED is nil, allows anonymous subroutines.  Matches up to the first \"=
:\"
-of attributes (if present), or end of the name or prototype (whatever is
-the last)."
-  (concat				; Assume n groups before this...
-   "\\("				; n+1=3Dname-group
-     cperl-white-and-comment-rex	; n+2=3Dpre-name
-     "\\(::[a-zA-Z_0-9:']+\\|[a-zA-Z_'][a-zA-Z_0-9:']*\\)" ; n+3=3Dname
-   "\\)"				; END n+1=3Dname-group
-   (if named "" "?")
-   "\\("				; n+4=3Dproto-group
-     cperl-maybe-white-and-comment-rex	; n+5=3Dpre-proto
-     "\\(([^()]*)\\)"			; n+6=3Dprototype
-   "\\)?"				; END n+4=3Dproto-group
-   "\\("				; n+7=3Dattr-group
-     cperl-maybe-white-and-comment-rex	; n+8=3Dpre-attr
-     "\\("				; n+9=3Dstart-attr
-        ":"
-	(if attr (concat
-		  "\\("
-		     cperl-maybe-white-and-comment-rex ; whitespace-comments
-		     "\\(\\sw\\|_\\)+"	; attr-name
-		     ;; attr-arg (1 level of internal parens allowed!)
-		     "\\((\\(\\\\.\\|[^\\()]\\|([^\\()]*)\\)*)\\)?"
-		     "\\("		; optional : (XXX allows trailing???)
-		        cperl-maybe-white-and-comment-rex ; whitespace-comments
-		     ":\\)?"
-		  "\\)+")
-	  "[^:]")
-     "\\)"
-   "\\)?"				; END n+6=3Dproto-group
-   ))
-
 ;; Tired of editing this in 8 places every time I remember that there
 ;; is another method-defining keyword
 (defvar cperl-sub-keywords
@@ -1414,28 +1471,8 @@ cperl-char-ends-sub-keyword-p
            when (eq char (aref keyword (1- (length keyword))))
            return t))
=20
-;; Details of groups in this are used in `cperl-imenu--create-perl-index'
-;;  and `cperl-outline-level'.
-;; Was: 2=3Dsub|package; now 2=3Dpackage-group, 5=3Dpackage-name 8=3Dsub-n=
ame (+3)
-(defvar cperl-imenu--function-name-regexp-perl
-  (concat
-   "^\\("				; 1 =3D all
-       "\\([ \t]*package"		; 2 =3D package-group
-          "\\("				; 3 =3D package-name-group
-	    cperl-white-and-comment-rex ; 4 =3D pre-package-name
-	       "\\([a-zA-Z_0-9:']+\\)\\)?\\)" ; 5 =3D package-name
-       "\\|"
-          "[ \t]*"
-          cperl-sub-regexp
-	  (cperl-after-sub-regexp 'named nil) ; 8=3Dname 11=3Dproto 14=3Dattr-sta=
rt
-	  cperl-maybe-white-and-comment-rex	; 15=3Dpre-block
-   "\\|"
-     "=3Dhead\\([1-4]\\)[ \t]+"		; 16=3Dlevel
-     "\\([^\n]+\\)$"			; 17=3Dtext
-   "\\)"))
-
 (defvar cperl-outline-regexp
-  (concat cperl-imenu--function-name-regexp-perl "\\|" "\\`"))
+  (concat "^[ \t]*" cperl--imenu-entries-regexp "\\|" "\\`"))
=20
 (defvar cperl-mode-syntax-table nil
   "Syntax table in use in CPerl mode buffers.")
@@ -1713,20 +1750,11 @@ cperl-mode
   (setq-local comment-end "")
   (setq-local comment-column cperl-comment-column)
   (setq-local comment-start-skip "#+ *")
-
-;;       "[ \t]*sub"
-;;	  (cperl-after-sub-regexp 'named nil) ; 8=3Dname 11=3Dproto 14=3Dattr-s=
tart
-;;	  cperl-maybe-white-and-comment-rex	; 15=3Dpre-block
-  (setq-local defun-prompt-regexp
-              (concat "^[ \t]*\\("
-                      cperl-sub-regexp
-                      (cperl-after-sub-regexp 'named 'attr-groups)
-                      "\\|"			; per toke.c
-                      "\\(BEGIN\\|UNITCHECK\\|CHECK\\|INIT\\|END\\|AUTOLOA=
D\\|DESTROY\\)"
-                      "\\)"
-                      cperl-maybe-white-and-comment-rex))
   (setq-local comment-indent-function #'cperl-comment-indent)
+
+  (setq-local beginning-of-defun-function #'cperl-beginning-of-defun)
   (setq-local fill-paragraph-function #'cperl-fill-paragraph)
+
   (setq-local parse-sexp-ignore-comments t)
   (setq-local indent-region-function #'cperl-indent-region)
   ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and=
 off!
@@ -2523,8 +2551,9 @@ cperl-indent-line
 	  (t
 	   (skip-chars-forward " \t")
 	   (if (listp indent) (setq indent (car indent)))
-	   (cond ((and (looking-at "[A-Za-z_][A-Za-z_0-9]*:[^:]")
-		       (not (looking-at "[smy]:\\|tr:")))
+	   (cond ((and (looking-at (rx (sequence (eval cperl--label-rx)
+                                                 (not (in ":")))))
+                       (not (looking-at (rx (eval cperl--false-label-rx)))=
))
 		  (and (> indent 0)
 		       (setq indent (max cperl-min-label-indent
 					 (+ indent cperl-label-offset)))))
@@ -2716,6 +2745,8 @@ cperl-sniff-for-indent
 			     (and (eq (preceding-char) ?\})
 				  (cperl-after-block-and-statement-beg
 				   (point-min))) ; Was start - too close
+                             (and char-after (char-equal char-after ?{)
+                                  (save-excursion (cperl-block-declaration=
-p)))
 			     (memq char-after (append ")]}" nil))
 			     (and (eq (preceding-char) ?\:) ; label
 				  (progn
@@ -2759,12 +2790,10 @@ cperl-sniff-for-indent
 		   ;; Back up over label lines, since they don't
 		   ;; affect whether our line is a continuation.
 		   ;; (Had \, too)
-		   (while;;(or (eq (preceding-char) ?\,)
-		       (and (eq (preceding-char) ?:)
-			    (or;;(eq (char-after (- (point) 2)) ?\') ; ????
-			     (memq (char-syntax (char-after (- (point) 2)))
-				   '(?w ?_))))
-		     ;;)
+                   (while (and (eq (preceding-char) ?:)
+                                 (re-search-backward
+                                  (rx (sequence (eval cperl--label-rx) poi=
nt))
+                                  nil t))
 		     ;; This is always FALSE?
 		     (if (eq (preceding-char) ?\,)
 			 ;; Will go to beginning of line, essentially.
@@ -2776,6 +2805,7 @@ cperl-sniff-for-indent
 		   (if (not (or (eq (1- (point)) containing-sexp)
                                 (and cperl-indent-parens-as-block
                                      (not is-block))
+                                (save-excursion (cperl-block-declaration-p=
))
 				(memq (preceding-char)
 				      (append (if is-block " ;{" " ,;{") '(nil)))
 				(and (eq (preceding-char) ?\})
@@ -2804,10 +2834,17 @@ cperl-sniff-for-indent
 			(forward-char 1)
 			(let ((colon-line-end 0))
 			  (while
-			      (progn (skip-chars-forward " \t\n")
-				     ;; s: foo : bar :x is NOT label
-				     (and (looking-at "#\\|\\([a-zA-Z0-9_$]+\\):[^:]\\|=3D[a-zA-Z]")
-					  (not (looking-at "[sym]:\\|tr:"))))
+			      (progn
+                                (skip-chars-forward " \t\n")
+				;; s: foo : bar :x is NOT label
+                                (and (looking-at
+                                      (rx
+                                       (or "#"
+                                           (sequence (eval cperl--label-rx)
+                                                     (not (in ":")))
+                                           (sequence "=3D" (in "a-zA-Z")))=
))
+				     (not (looking-at
+                                           (rx (eval cperl--false-label-rx=
))))))
 			    ;; Skip over comments and labels following openbrace.
 			    (cond ((=3D (following-char) ?\#)
 				   (forward-line 1))
@@ -3066,7 +3103,10 @@ cperl-calculate-indent
 		 ;; If line starts with label, calculate label indentation
 		 (if (save-excursion
 		       (beginning-of-line)
-		       (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*:[^:]"))
+                       (looking-at (rx
+                                    (sequence (0+ space)
+                                              (eval cperl--label-rx)
+                                              (not (in ":"))))))
 		     (if (> (current-indentation) cperl-min-label-indent)
 			 (- (current-indentation) cperl-label-offset)
 		       ;; Do not move `parse-data', this should
@@ -4645,15 +4685,19 @@ cperl-backward-to-noncomment
 	    (if (< p (point)) (goto-char p))
 	    (setq stop t))))))
=20
-;; Used only in `cperl-calculate-indent'...
+;; Used only in `cperl-sniff-for-indent'...
 (defun cperl-block-p ()
-  "Point is before ?\\{.  Checks whether it starts a block."
+  "Point is before ?\\{.  Returns true if it starts a block."
   ;; No save-excursion!  This is more a distinguisher of a block/hash ref.=
..
   (cperl-backward-to-noncomment (point-min))
   (or (memq (preceding-char) (append ";){}$@&%\C-@" nil)) ; Or label!  \C-=
@ at bobp
 					; Label may be mixed up with `$blah :'
       (save-excursion (cperl-after-label))
+      ;; text with the 'attrib-group property is also covered by the
+      ;; next clause.  We keep it because it is faster (for
+      ;; subroutines with attributes).
       (get-text-property (cperl-1- (point)) 'attrib-group)
+      (save-excursion (cperl-block-declaration-p))
       (and (memq (char-syntax (preceding-char)) '(?w ?_))
 	   (progn
 	     (backward-sexp)
@@ -4691,20 +4735,16 @@ cperl-after-block-p
 	      (save-excursion (cperl-after-label))
 	      ;; sub :attr {}
 	      (get-text-property (cperl-1- (point)) 'attrib-group)
+              (save-excursion (cperl-block-declaration-p))
 	      (if (memq (char-syntax (preceding-char)) '(?w ?_)) ; else {}
 		  (save-excursion
 		    (forward-sexp -1)
 		    ;; else {}     but not    else::func {}
-		    (or (and (looking-at "\\(else\\|catch\\|try\\|continue\\|grep\\|map\=
\|BEGIN\\|END\\|UNITCHECK\\|CHECK\\|INIT\\)\\>")
-			     (not (looking-at "\\(\\sw\\|_\\)+::")))
-			;; sub f {}
-			(progn
-			  (cperl-backward-to-noncomment lim)
-			  (and (cperl-char-ends-sub-keyword-p (preceding-char))
-			       (progn
-				 (forward-sexp -1)
-				 (looking-at
-                                  (concat cperl-sub-regexp "[ \t\n\f#]")))=
))))
+                    (or (and (looking-at
+                              (rx-to-string `(sequence
+                                   (eval (cons 'or cperl-bare-block-keywor=
ds))
+                                   word-end)))
+			     (not (looking-at "\\(\\sw\\|_\\)+::")))))
 		;; What precedes is not word...  XXXX Last statement in sub???
 		(cperl-after-expr-p lim))))
       (error nil))))
@@ -5326,9 +5366,9 @@ cperl-imenu--create-perl-index
 	      (setq current-package-end (save-excursion
 					  (goto-char (match-beginning 3))
 					  (forward-sexp)
-					  (point)))
+					  (point))))
 	    (push (cons name marker) index-package-alist)
-	    (push (cons (concat "package " name) marker) index-unsorted-alist))))
+	    (push (cons (concat "package " name) marker) index-unsorted-alist)))
 	 ((match-string 5)              ; found a sub name!
 	  (unless (nth 4 state)         ; skip if in a comment
 	    (setq name (match-string-no-properties 5)
@@ -5592,10 +5632,24 @@ cperl-init-faces
 		       2 font-lock-string-face t)))
 	    '("[[ \t{,(]\\(-?[a-zA-Z0-9_:]+\\)[ \t]*=3D>" 1
 	      font-lock-string-face t)
-	    '("^[ \t]*\\([a-zA-Z0-9_]+[ \t]*:\\)[ \t]*\\($\\|{\\|\\<\\(until\\|wh=
ile\\|for\\(each\\)?\\|do\\)\\>\\)" 1
-	      font-lock-constant-face)	; labels
-	    '("\\<\\(continue\\|next\\|last\\|redo\\|break\\|goto\\)\\>[ \t]+\\([=
a-zA-Z0-9_:]+\\)" ; labels as targets
-	      2 font-lock-constant-face)
+            ;; labels
+            `(,(rx-to-string
+                `(sequence
+                  (0+ space)
+                  (group (eval cperl--label-rx))
+                  (0+ space)
+                  (or line-end "#" "{"
+                      (sequence word-start
+                                (or "until" "while" "for" "foreach" "do")
+                                word-end))))
+              1 font-lock-constant-face)
+            ;; labels as targets (no trailing colon!)
+            `(,(rx-to-string
+                '(sequence
+                 (or "continue" "next" "last" "redo" "break" "goto")
+                 (0+ space)
+                 (group (eval cperl--basic-identifier-rx))))
+              1 font-lock-constant-face)
 	    ;; Uncomment to get perl-mode-like vars
             ;;; '("[$*]{?\\(\\sw+\\)" 1 font-lock-variable-name-face)
             ;;; '("\\([@%]\\|\\$#\\)\\(\\sw+\\)"
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl b=
/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl
index 8c1883a10f..33d0d7942e 100644
--- a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl
@@ -50,3 +50,79 @@
   quuux;
 }
 # -------- if-then-else: end --------
+
+# -------- labels: input --------
+{
+LABEL:
+for (0..1) {
+next LABEL if $_;
+unless ($_) last LABEL;
+}
+LABEL_WITH_SPACE 	:
+while (1) {
+last LABEL_WITH_SPACE;
+}
+LABEL_WITH_COMMENT : # explain that label
+say "This label has a comment."
+}
+# -------- labels: expected output --------
+{
+ LABEL:
+  for (0..1) {
+    next LABEL if $_;
+    unless ($_) last LABEL;
+  }
+ LABEL_WITH_SPACE 	:
+  while (1) {
+    last LABEL_WITH_SPACE;
+  }
+ LABEL_WITH_COMMENT :		# explain that label
+  say "This label has a comment."
+}
+# -------- labels: end --------
+
+# -------- packages: input --------
+package Foo {
+package Foo::Inner::One {
+...;
+}
+package Foo::Inner::Two {
+...;
+}
+}
+# -------- packages: expected output --------
+package Foo {
+  package Foo::Inner::One {
+    ...;
+  }
+  package Foo::Inner::Two {
+    ...;
+  }
+}
+# -------- packages: end --------
+
+# -------- braces after newline: input --------
+package Outer {
+package Inner
+{
+sub foo
+{
+}
+sub bar
+{
+}
+}
+}
+# -------- braces after newline: expected output --------
+package Outer {
+  package Inner
+  {
+    sub foo
+    {
+    }
+    sub bar
+    {
+    }
+  }
+}
+# -------- braces after newline: end --------
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-region.p=
l b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-region.pl
new file mode 100644
index 0000000000..219d5292ca
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-region.pl
@@ -0,0 +1,118 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use 5.020;
+
+# This file contains test input and expected output for the tests in
+# cperl-mode-tests.el, cperl-test-indent-region.  The code is
+# syntactically valid, but doesn't make much sense.
+
+# (Bug#11733) https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11733
+# -------- sub \n brace: input --------
+sub foo
+  {
+  }
+
+sub bar
+  {
+  }
+# -------- sub \n brace: expected output --------
+sub foo
+{
+}
+
+sub bar
+{
+}
+# -------- sub \n brace: end --------
+
+# -------- map \n brace: input --------
+{
+my %hash =3D map
+{
+$_ =3D 1
+}
+@_;
+}
+# -------- map \n brace: expected output --------
+{
+  my %hash =3D map
+    {
+      $_ =3D 1
+    }
+    @_;
+}
+# -------- map \n brace: end --------
+
+# -------- if \n brace: input --------
+if (1 =3D=3D @_)
+  {
+    say "one argument";
+  } else {
+    say "No arguments, or plenty";
+  }
+# -------- if \n brace: expected output --------
+if (1 =3D=3D @_) {
+  say "one argument";
+} else {
+  say "No arguments, or plenty";
+}
+# -------- if \n brace: end --------
+
+# -------- simple sub: input --------
+sub middle {
+  my ($left,$right) =3D @_;
+  return  0.5 * ($left + $right);
+}
+$this_should_be_justified =3D 'left';
+# -------- simple sub: expected output --------
+sub middle {
+  my ($left,$right) =3D @_;
+  return  0.5 * ($left + $right);
+}
+$this_should_be_justified =3D 'left';
+# -------- simple sub: end --------
+
+# ------- hash reference: input --------
+my $result =3D { ok =3D> 'true' }
+  if ($this_should_be_indented =3D=3D 'cperl-continued-statement-offset');
+# ------- hash reference: expected output --------
+my $result =3D { ok =3D> 'true' }
+  if ($this_should_be_indented =3D=3D 'cperl-continued-statement-offset');
+# ------- hash reference: end --------
+
+# The following syntax was introduced in Perl v5.14:
+# ------- package BLOCK: input --------
+package Puck {
+our $cperl_indent_level =3D 4;
+}
+our $good_indentation =3D 0;
+# ------- package BLOCK: expected output --------
+package Puck {
+  our $cperl_indent_level =3D 4;
+}
+our $good_indentation =3D 0;
+# ------- package BLOCK: end --------
+
+# as of Perl 5.18, subroutines can be lexical
+# -------- simple sub: input --------
+package Pick 1.23 {
+  my sub middle {
+    my ($left,$right) =3D @_;
+    return  0.5 * ($left + $right);
+    $this_should_be_indented =3D
+      $cperl_indent_level;
+  }
+}
+$this_should_be_justified =3D 'left';
+# -------- simple sub: expected output --------
+package Pick 1.23 {
+  my sub middle {
+    my ($left,$right) =3D @_;
+    return  0.5 * ($left + $right);
+    $this_should_be_indented =3D
+      $cperl_indent_level;
+  }
+}
+$this_should_be_justified =3D 'left';
+# -------- simple sub: end --------
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/=
cperl-mode-tests.el
index 61e4ece49b..1bcc41ab9f 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -103,6 +103,14 @@ cperl-test-indent-exp
    (ert-resource-file "cperl-indent-exp.pl")
    (cperl-indent-exp))) ; here we go!
=20
+(ert-deftest cperl-test-indent-region ()
+  "Test indenting of regions which can span more than one
+expression."
+  (skip-unless (eq cperl-test-mode #'cperl-mode))
+  (cperl--run-test-cases
+   (ert-resource-file "cperl-indent-region.pl")
+   (indent-region (point-min) (point-max))))
+
 (ert-deftest cperl-test-indent-styles ()
   (skip-unless (eq cperl-test-mode #'cperl-mode))
   (cperl--run-test-cases
@@ -189,17 +197,17 @@ cperl-test-ws-regexp
 	 '(" " "\t" "\n"))
 	(invalid
 	 '("a" "  " "")))
-    (cperl-test--validate-regexp cperl--ws-regexp
+    (cperl-test--validate-regexp (rx (eval cperl--ws-rx))
 				 valid invalid)))
=20
-(ert-deftest cperl-test-ws-or-comment-regexp ()
+(ert-deftest cperl-test-ws+-rx ()
   "Tests sequences of whitespace and comment lines."
   (let ((valid
 	 `(" " "\t#\n" "\n# \n"
 	   ,(concat "# comment\n" "# comment\n" "\n" "#comment\n")))
 	(invalid
 	 '("=3Dhead1 NAME\n" )))
-    (cperl-test--validate-regexp cperl--ws-or-comment-regexp
+    (cperl-test--validate-regexp (rx (eval cperl--ws+-rx))
 				 valid invalid)))
=20
 (ert-deftest cperl-test-version-regexp ()
--=20
2.20.1


--=-=-=--




Acknowledgement sent to haj@HIDDEN (Harald Jörg):
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#46889; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 10 Mar 2021 14:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.