unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* CPerl Indentation after subs with print in their names
@ 2007-11-22 16:43 Stefan Kamphausen
  2007-11-23  8:41 ` Ilya Zakharevich
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Kamphausen @ 2007-11-22 16:43 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

today I came across a subtle mis-indentation in Perl-code.  Assume a
file like this:

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

sub anything {
    print "OK\n";
}
# here indentation is OK
sub print_something {
    print "Something\n";
}
  # but here not ??
----------------------------------------------------------------------

If I remove the "print_" from the the name of the subroutine
everything indents correctly.  I tried a few other special words from
the Perl language:

Function   Indentation
printf     wrong
while      OK
sprintf    OK
substr     OK
open       OK


This happens with:
Gnu Emacs 22.1.1, cperl-version 5.22.


Steps to reproduce:
shell> emacs -q test.pl
emacs> M-x cperl-mode
emacs> M-x goto-line 12  ;; the line # but here not ??
emacs> TAB


Is this a bug or some stupidity on my part?


Regards,
Stefan
-- 
Stefan Kamphausen --- http://www.skamphausen.de
a blessed +42 regexp of confusion (weapon in hand)
You hit. The format string crumbles and turns to dust.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-12-16 20:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-22 16:43 CPerl Indentation after subs with print in their names Stefan Kamphausen
2007-11-23  8:41 ` Ilya Zakharevich
2007-11-23  9:40   ` Stefan Kamphausen
2007-11-23 23:19     ` Ilya Zakharevich
2007-11-26  8:21       ` Stefan Kamphausen
2007-11-26 23:05         ` Ilya Zakharevich
2007-11-27  8:14           ` Stefan Kamphausen
2007-11-28  9:05             ` Tim X
2007-12-16 18:41             ` David Combs
2007-12-16 20:21               ` Ilya Zakharevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).