GNU bug report logs - #42169
26.1; cperl-mode: Syntax "package NAME { ... }" not recognized

Previous Next

Package: emacs;

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

Date: Thu, 2 Jul 2020 19:37:02 UTC

Severity: minor

Tags: confirmed

Merged with 28640

Found in versions 25.2, 26.1, 26.2

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Darren Embry <dse <at> webonastick.com>
Subject: bug#28640: closed (Fixed in Emacs 28.1)
Date: Wed, 21 Jun 2023 11:41:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#42169: 25.2; cperl-mode indentation after package BLOCKs

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 28640 <at> debbugs.gnu.org.

-- 
42169: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42169
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Harald Jörg <haj <at> posteo.de>
To: 42169-done <at> debbugs.gnu.org
Subject: Fixed in Emacs 28.1
Date: Wed, 21 Jun 2023 11:40:00 +0000
This has been fixed in Emacs 28, closing the bug.
-- 
Cheers,
haj

[Message part 3 (message/rfc822, inline)]
From: Darren Embry <dse <at> webonastick.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; cperl-mode indentation after package BLOCKs
Date: Fri, 29 Sep 2017 00:37:00 -0400
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=/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 ‘normal-mode’ 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))



This bug report was last modified 1 year and 336 days ago.

Previous Next


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