emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64364: closed (30.5; cperl-mode: Bad indentation for subroutine attr


From: GNU bug Tracking System
Subject: bug#64364: closed (30.5; cperl-mode: Bad indentation for subroutine attrs / signatures)
Date: Sat, 01 Jul 2023 20:27:02 +0000

Your message dated Sat, 01 Jul 2023 20:26:02 +0000
with message-id <87h6qnnztx.fsf@oook.m.uunet.de>
and subject line Indentation of subroutine signatures has been fixed in the 
repository.
has caused the debbugs.gnu.org bug report #64364,
regarding 30.5; cperl-mode: Bad indentation for subroutine attrs / signatures
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
64364: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64364
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.5; cperl-mode: Bad indentation for subroutine attrs / signatures Date: Fri, 30 Jun 2023 12:56:11 +0000
Owner: haj@posteo.de

Since Perl 5.20, Perl subroutines can be declared with signatures.
When subroutine signatures are written in a line of their own,
indentation in cperl-mode gets it wrong.

Example: This is how it should look like (All examples
with cperl-indentation-style set to "PBP"), and also
how perl-mode indents it:
--------------------------------------------------
package P {
    sub way { ...; }

    sub bus
        :lvalue
        ($sig,$na,@ture)
    {
        ...;
    }
}
--------------------------------------------------

This is how it is indented when I mark the whole buffer and call
<M-x> indent-region.  The subroutine attribute and signature should be
indented as continuation lines, but they aren't.
--------------------------------------------------
package P {
    sub way { ...; }

    sub bus
    :lvalue
    ($sig,$na,@ture)
    {
        ...;
    }
}
--------------------------------------------------

This is how it is indented when I indent every single line with <TAB>
(which runs `cperl-indent-command').  The code block of the subroutine
and everything up to the closing brace of the enclosing package is
indented too far.
--------------------------------------------------
package P {
    sub way { ...; }

    sub bus
        :lvalue
        ($sig,$na,@ture)
        {
            ...;
        }
    }
--------------------------------------------------

I am working on fixing this, as part of properly supporting subroutine
signatures in cperl-mode. The purpose of this bug report is a
demonstration of the symptoms.
-- 
Cheers,
haj



--- End Message ---
--- Begin Message --- Subject: Indentation of subroutine signatures has been fixed in the repository. Date: Sat, 01 Jul 2023 20:26:02 +0000
Indentation of Perl code with subroutine signatures has been fixed in
the Emacs master branch.  cperl-mode.el as available in the repository
can be used with Emacs 28 and 27 (and could be backported to Emacs 26 if
there is interest).

-- 
Cheers,
haj


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]