GNU bug report logs - #28640
25.2; cperl-mode indentation after package BLOCKs

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; Severity: minor; Reported by: Darren Embry <dse@HIDDEN>; Keywords: confirmed; merged with #42169; dated Fri, 29 Sep 2017 04:37:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 28640 42169. Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 26.2. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) confirmed. Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 28640) by debbugs.gnu.org; 5 Jul 2019 20:21:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 05 16:21:10 2019
Received: from localhost ([127.0.0.1]:53833 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hjUhi-0008AF-KM
	for submit <at> debbugs.gnu.org; Fri, 05 Jul 2019 16:21:10 -0400
Received: from mail-wr1-f53.google.com ([209.85.221.53]:44812)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1hjUhh-0008A1-1W
 for 28640 <at> debbugs.gnu.org; Fri, 05 Jul 2019 16:21:09 -0400
Received: by mail-wr1-f53.google.com with SMTP id b2so9791916wrx.11
 for <28640 <at> debbugs.gnu.org>; Fri, 05 Jul 2019 13:21:09 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=zqwwtwHfvbs4O7EkR2nUASqbyUBIDgHFuACyWsd1pyA=;
 b=cQWgHgFa/MMc8sfIG/2WrZwkvYEDDIIscUJ5OTAAHpd0N0J6k37tXh2yF3kSWpKa7h
 /on5cBjTOfoRPAJlBC5ndxMAbTEw8dhivPoOjz1C3hA7nmXwmlsvaQD2oe8xe8u5v+yg
 klODEB2QfiLAWwmLwlRwpbPpkf9vb2SI2ocCfbIRXXq9sigfY25XOgoF5kuE517yn+Aq
 tD8HByk+iL9KLNYCQZNCpVgZ6Sf7w5gvzlzkZX15pVdst4AYupCpj5qh4UL5clFITOTL
 w/J4lruyCLLYHJoWaZFRrsTubdS5u5Mzqk1FJSVkAoL45Kjax4OTzobLYpYk18Z1kruG
 4Gbg==
X-Gm-Message-State: APjAAAVAUwa4i5bbZATEwHrwtAACULRWWmMnEADfpTj8Y0ZTx4hbkpOw
 8Ctz0xFV8C2Rht4gDG4bwcVC1wPfiV9CP91pDLtD/8lz
X-Google-Smtp-Source: APXvYqykCwjcvXt/vXrQHP7DoDleWzzwQeSVQ2ddqf2+s2vaksviCLZrjzuYkLLZzazXgW7xJt4r/kMLzVqq90CvFvU=
X-Received: by 2002:a5d:4609:: with SMTP id t9mr4854458wrq.85.1562358063156;
 Fri, 05 Jul 2019 13:21:03 -0700 (PDT)
MIME-Version: 1.0
From: Stefan Kangas <stefan@HIDDEN>
Date: Fri, 5 Jul 2019 22:20:52 +0200
Message-ID: <CADwFkmkdarhXdHtmPh36Kr6aBx6d-d9WmvW+J=97HHyjMHO00Q@HIDDEN>
Subject: Re: bug#28640: 25.2; cperl-mode indentation after package BLOCKs
To: 28640 <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 28640
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 (-)

Darren Embry <dse@HIDDEN> writes:

> Hello GNU Emacs developers,
>
> I'm getting the following automatic indentation in cperl-mode for a
> script containing more than one BLOCK:
>
>     #!/usr/bin/env perl
>     use warnings;
>     use strict;
>
>     package Foo {
>       use Moose;
>     }
>       package Bar {
>         use Moose;
>       }
>
>       # Local Variables:
>       # mode: cperl
>       # End:

I can reproduce this on Emacs 26.2 and current master.

Best regards,
Stefan Kangas




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

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


Received: (at submit) by debbugs.gnu.org; 29 Sep 2017 04:36:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 29 00:36:19 2017
Received: from localhost ([127.0.0.1]:37382 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dxn2A-0007Oe-Lp
	for submit <at> debbugs.gnu.org; Fri, 29 Sep 2017 00:36:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dse@HIDDEN>) id 1dxn29-0007OR-84
 for submit <at> debbugs.gnu.org; Fri, 29 Sep 2017 00:36:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dse@HIDDEN>) id 1dxn22-0003cg-P1
 for submit <at> debbugs.gnu.org; Fri, 29 Sep 2017 00:36:11 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:45991)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <dse@HIDDEN>)
 id 1dxn22-0003cY-MO
 for submit <at> debbugs.gnu.org; Fri, 29 Sep 2017 00:36:10 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43430)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dse@HIDDEN>) id 1dxn21-000885-4P
 for bug-gnu-emacs@HIDDEN; Fri, 29 Sep 2017 00:36:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <dse@HIDDEN>) id 1dxn1y-0003ZD-0p
 for bug-gnu-emacs@HIDDEN; Fri, 29 Sep 2017 00:36:09 -0400
Received: from barnacle2.webonastick.com ([52.71.72.97]:39176 helo=barnacle2)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <dse@HIDDEN>) id 1dxn1x-0003Ya-S3
 for bug-gnu-emacs@HIDDEN; Fri, 29 Sep 2017 00:36:05 -0400
Received: by barnacle2 (Postfix, from userid 1001)
 id A7D4EC011B; Fri, 29 Sep 2017 00:37:00 -0400 (EDT)
From: Darren Embry <dse@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.2; cperl-mode indentation after package BLOCKs
Date: Fri, 29 Sep 2017 00:37:00 -0400
Message-ID: <86zi9ece8j.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
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: -5.0 (-----)


Hello GNU Emacs developers,

I'm getting the following automatic indentation in cperl-mode for a
script containing more than one BLOCK:

    #!/usr/bin/env perl
    use warnings;
    use strict;

    package Foo {
      use Moose;
    }
      package Bar {
        use Moose;
      }

      # Local Variables:
      # mode: cperl
      # End:

Package BLOCKs were created in Perl 5.14 as an alternative syntax that
only applies the specified namespace to a BLOCK:

    https://www.perl.com/pub/2011/05/new-features-of-perl-514-package-block=
.html

Obviously the second package BLOCK in my opinion should be indented the
same as the first:

    package Foo {
      use Moose;
    }
    package Bar {
      use Moose;
    }

With opening braces on their own lines, auto-indentation becomes a
little bit weirder:

    #!/usr/bin/env perl
    use warnings;
    use strict;

    package Foo
      {
        use Moose;
      }
      package Bar
      {
        use Moose;
      }

      # Local Variables:
      # mode: cperl
      # End:

My present workaround is to append a ; to every package BLOCK:

    package Foo {
      use Moose;
    };

I've also discovered another workaround: change the value of
`cperl-continued-statement-offset' to 0.  That may help guide you to
what cperl-mode thinks is going on, as well as where to look for and/or
fix the problem.

Thanks,
Darren



In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu)
 of 2017-08-03 built on barnacle2.webonastick.com
System Description:	Ubuntu 14.04.4 LTS

Configured using:
 'configure --prefix=3D/usr/local'

Configured features:
SOUND NOTIFY ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: CPerl

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
next-line: End of buffer
Saving file /home/dse/foo.pl...
Wrote /home/dse/foo.pl
You can run the command =E2=80=98normal-mode=E2=80=99 with M-x nor-m RET
Mark set [3 times]
Quit
Saving file /home/dse/foo.pl...
Wrote /home/dse/foo.pl

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode cl-loaddefs pcase
cl-lib mail-prsvr mail-utils cperl-mode easymenu perl-mode regexp-opt
term/xterm xterm time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote inotify multi-tty
make-network-process emacs)

Memory information:
((conses 16 90853 5234)
 (symbols 48 19556 0)
 (miscs 40 49 124)
 (strings 32 16289 5349)
 (string-bytes 1 483067)
 (vectors 16 10278)
 (vector-slots 8 392683 13537)
 (floats 8 147 274)
 (intervals 56 222 23)
 (buffers 976 19)
 (heap 1024 26088 633))




Acknowledgement sent to Darren Embry <dse@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#28640; 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, 26 Aug 2020 16:00:02 UTC

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