GNU bug report logs - #79269
30.1; cperl-mode does not handle signatures correctly

Previous Next

Package: emacs;

Reported by: John Ciolfi <john.ciolfi.32 <at> gmail.com>

Date: Tue, 19 Aug 2025 16:18:02 UTC

Severity: normal

Found in version 30.1

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

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Ciolfi <john.ciolfi.32 <at> gmail.com>, Harald Jörg
 <haj <at> posteo.de>
Cc: 79269 <at> debbugs.gnu.org
Subject: Re: bug#79269: 30.1; cperl-mode does not handle signatures correctly
Date: Tue, 19 Aug 2025 19:36:21 +0300
> From: John Ciolfi <john.ciolfi.32 <at> gmail.com>
> Date: Tue, 19 Aug 2025 12:05:37 -0400
> 
> 
> 1. In a temporary directory, say ~/tmp/, get latest cperl-mode.el from
>    https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/cperl-mode.el
>    I used the Jul-28-2025 version
>    https://github.com/emacs-mirror/emacs/blob/cef4302d309e26c2191821ba998518fb89fff54e/lisp/progmodes/cperl-mode.el
> 
> 2. cd ~/tmp
> 
> 3. emacs -Q -L .           # Using emacs 30.1
> 
> 4. M-x byte-compile-file RET cperl-mode.el RET
> 
> 5. C-x C-f foo.pl
> 
>    C-x h   # select all of foo.pl
>    C-M-\   # indent foo.pl
> 
> Here's the indented foo.pl. Notice that there are a couple problems
> which appears to be due to the incorrect handling of perl signatures.
> Note, perl-mode.el seems to handle signatures correctly, so maybe that
> code can be borrowed for cperl-mode.el?
> 
> 
> # -*- mode: cperl -*-
> use strict;
> use warnings;
> use experimental 'signatures';
> 
> foo(1);
> 
> sub foo (
> 	 $in1,
> 	 $optionsHPtr = {},
> 	 $otherOption1 = 1,	# Bug: wrong face for this option
> 	) {
>  
>    my $a = 1;  # Bug: should be indented by 2 spaces
> 
>  # Bug: following are not indented due to use of signatures
>  my $b = 2;
>  return $a + $b + $in1;
> }

Thanks.

Harald, any comments or suggestions?




This bug report was last modified 14 days ago.

Previous Next


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