From: Darren Embry <dse@webonastick.com>
To: 28640@debbugs.gnu.org
Subject: bug#28640: 25.2; cperl-mode indentation after package BLOCKs
Date: Fri, 29 Sep 2017 00:37:00 -0400 [thread overview]
Message-ID: <86zi9ece8j.fsf@barnacle2.webonastick.com> (raw)
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))
next reply other threads:[~2017-09-29 4:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-29 4:37 Darren Embry [this message]
2019-07-05 20:20 ` bug#28640: 25.2; cperl-mode indentation after package BLOCKs Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86zi9ece8j.fsf@barnacle2.webonastick.com \
--to=dse@webonastick.com \
--cc=28640@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.