GNU bug report logs - #74245
30.0.92; CPerl subroutine signatures are left open when last param is $

Previous Next

Package: emacs;

Reported by: Peter Oliver <p.d.oliver <at> mavit.org.uk>

Date: Thu, 7 Nov 2024 19:20:02 UTC

Severity: normal

Found in version 30.0.92

Fixed in version 30.0

Done: Harald Jörg <haj <at> posteo.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74245 in the body.
You can then email your comments to 74245 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Thu, 07 Nov 2024 19:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Peter Oliver <p.d.oliver <at> mavit.org.uk>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Nov 2024 19:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Oliver <p.d.oliver <at> mavit.org.uk>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.92; CPerl subroutine signatures are left open when last param
 is $
Date: Thu, 7 Nov 2024 19:19:31 +0000 (GMT)
Perl subroutine signatures can include a variable with no name, just a bare $, to indicate that a parameter should be ignored.  If this happens in the last place, CPerl mode in Emacs 30.0.92 mishandles it, and is unable to see the closing ).  Consequently, it matches parentheses incorrectly, and misindents subsequent blocks.

I have a test that I will send in as a patch, once I have a bug number.

This issue is not present in Emacs 29.4.

-- 
Peter Oliver




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Thu, 07 Nov 2024 19:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Peter Oliver <p.d.oliver <at> mavit.org.uk>
To: 74245 <at> debbugs.gnu.org
Subject: Re: 30.0.92; CPerl subroutine signatures are left open when last
 param is $
Date: Thu, 7 Nov 2024 19:29:58 +0000 (GMT)
[Message part 1 (text/plain, inline)]
Test attached.

-- 
Peter Oliver
[0001-cperl-mode.el-Add-a-test-for-Bug-74245.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Fri, 08 Nov 2024 12:14:01 GMT) Full text and rfc822 format available.

Message #11 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Peter Oliver <p.d.oliver <at> mavit.org.uk>, 74245 <at> debbugs.gnu.org
Cc: Harald Jörg <haj <at> posteo.de>
Subject: Re: bug#74245: 30.0.92; CPerl subroutine signatures are left open
 when last param is $
Date: Fri, 8 Nov 2024 12:12:46 +0000
Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:

> Perl subroutine signatures can include a variable with no name, just a bare $, to indicate that a parameter should be ignored.  If this happens in the last place, CPerl mode in Emacs 30.0.92 mishandles it, and is unable to see the closing ).  Consequently, it matches parentheses incorrectly, and misindents subsequent blocks.
>
> I have a test that I will send in as a patch, once I have a bug number.
>
> This issue is not present in Emacs 29.4.

Harald, could you please take a look at this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Thu, 02 Jan 2025 02:06:02 GMT) Full text and rfc822 format available.

Message #14 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Peter Oliver <p.d.oliver <at> mavit.org.uk>
Cc: Harald Jörg <haj <at> posteo.de>, 74245 <at> debbugs.gnu.org
Subject: Re: bug#74245: 30.0.92; CPerl subroutine signatures are left open
 when last param is $
Date: Wed, 1 Jan 2025 20:05:29 -0600
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:
>
>> Perl subroutine signatures can include a variable with no name, just a bare $,
>> to indicate that a parameter should be ignored.  If this happens in the last
>> place, CPerl mode in Emacs 30.0.92 mishandles it, and is unable to see the
>> closing ).  Consequently, it matches parentheses incorrectly, and misindents
>> subsequent blocks.
>>
>> I have a test that I will send in as a patch, once I have a bug number.
>>
>> This issue is not present in Emacs 29.4.
>
> Harald, could you please take a look at this?

Friendly ping.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Sun, 12 Jan 2025 00:36:02 GMT) Full text and rfc822 format available.

Message #17 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Harald Jörg <haj <at> posteo.de>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Peter Oliver <p.d.oliver <at> mavit.org.uk>, 74245 <at> debbugs.gnu.org
Subject: Re: bug#74245: 30.0.92; CPerl subroutine signatures are left open
 when last param is $
Date: Sun, 12 Jan 2025 00:34:57 +0000
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:
>
>> Perl subroutine signatures can include a variable with no name, just
>> a bare $, to indicate that a parameter should be ignored.  If this
>> happens in the last place, CPerl mode in Emacs 30.0.92 mishandles
>> it, and is unable to see the closing ).  Consequently, it matches
>> parentheses incorrectly, and misindents subsequent blocks.
>>
>> I have a test that I will send in as a patch, once I have a bug number.
>>
>> This issue is not present in Emacs 29.4.
>
> Harald, could you please take a look at this?

I apologize, for some reason this bug report slipped by me.  I'll have a
look next week.  I can reproduce the bug.

On first glance, there's a workaround: Add a trailing comma to the
parameter list.  Ugly, but prevents the indentation from being messed up:

    sub ignore ($first, $,) {}

-- 
Cheers,
haj





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Mon, 13 Jan 2025 12:01:02 GMT) Full text and rfc822 format available.

Message #20 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Harald Jörg <haj <at> posteo.de>
To: Peter Oliver <p.d.oliver <at> mavit.org.uk>
Cc: 74245 <at> debbugs.gnu.org
Subject: Re: bug#74245: 30.0.92; CPerl subroutine signatures are left open
 when last param is $
Date: Mon, 13 Jan 2025 12:00:24 +0000
Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:

> Perl subroutine signatures can include a variable with no name, just a
> bare $, to indicate that a parameter should be ignored.  If this
> happens in the last place, CPerl mode in Emacs 30.0.92 mishandles it,
> and is unable to see the closing ).  Consequently, it matches
> parentheses incorrectly, and misindents subsequent blocks.
>
> I have a test that I will send in as a patch, once I have a bug number.
>
> This issue is not present in Emacs 29.4.

Thank you for the report and for the test!

This is now fixed in the emacs-30 branch.

I would very much like to add the test and resource file as well.  Do we
need to do the copyright paperwork?
-- 
Cheers,
haj




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Mon, 13 Jan 2025 12:45:01 GMT) Full text and rfc822 format available.

Message #23 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Peter Oliver <p.d.oliver <at> mavit.org.uk>
To: Harald Jörg <haj <at> posteo.de>
Cc: 74245 <at> debbugs.gnu.org
Subject: Re: bug#74245: 30.0.92; CPerl subroutine signatures are left open
 when last param is $
Date: Mon, 13 Jan 2025 12:44:13 +0000 (GMT)
[Message part 1 (text/plain, inline)]
On Mon, 13 Jan 2025, Harald Jörg wrote:

> Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:
>
>> I have a test that I will send in as a patch, once I have a bug number.
>
> I would very much like to add the test and resource file as well.  Do we
> need to do the copyright paperwork?

The paperwork is done.

-- 
Peter Oliver

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Mon, 13 Jan 2025 13:23:02 GMT) Full text and rfc822 format available.

Message #26 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Harald Jörg <haj <at> posteo.de>
Cc: p.d.oliver <at> mavit.org.uk, 74245 <at> debbugs.gnu.org
Subject: Re: bug#74245: 30.0.92;
 CPerl subroutine signatures are left open when last param is $
Date: Mon, 13 Jan 2025 15:22:24 +0200
> Cc: 74245 <at> debbugs.gnu.org
> From: Harald Jörg <haj <at> posteo.de>
> Date: Mon, 13 Jan 2025 12:00:24 +0000
> 
> I would very much like to add the test and resource file as well.  Do we
> need to do the copyright paperwork?

Peter's assignment is on file, so we are okay in that department.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#74245; Package emacs. (Mon, 13 Jan 2025 16:19:02 GMT) Full text and rfc822 format available.

Message #29 received at 74245 <at> debbugs.gnu.org (full text, mbox):

From: Harald Jörg <haj <at> posteo.de>
To: Peter Oliver <p.d.oliver <at> mavit.org.uk>
Cc: 74245 <at> debbugs.gnu.org
Subject: Re: bug#74245: 30.0.92; CPerl subroutine signatures are left open
 when last param is $
Date: Mon, 13 Jan 2025 16:17:49 +0000
close 74245 30.0
thanks

Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:

> On Mon, 13 Jan 2025, Harald Jörg wrote:
>
>> Peter Oliver <p.d.oliver <at> mavit.org.uk> writes:
>>
>>> I have a test that I will send in as a patch, once I have a bug number.
>>
>> I would very much like to add the test and resource file as well.  Do we
>> need to do the copyright paperwork?
>
> The paperwork is done.

Excellent!  I committed the test (thanks again!) and close the bug now.
-- 
Cheers,
haj





bug marked as fixed in version 30.0, send any further explanations to 74245 <at> debbugs.gnu.org and Peter Oliver <p.d.oliver <at> mavit.org.uk> Request was from Harald Jörg <haj <at> posteo.de> to control <at> debbugs.gnu.org. (Mon, 13 Jan 2025 16:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Feb 2025 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 125 days ago.

Previous Next


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