all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kamphausen <skampi@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: CPerl Indentation after subs with print in their names
Date: Thu, 22 Nov 2007 17:43:06 +0100	[thread overview]
Message-ID: <85zlx6qlid.fsf@usenet.my.skamphausen.de> (raw)

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.

             reply	other threads:[~2007-11-22 16:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22 16:43 Stefan Kamphausen [this message]
2007-11-23  8:41 ` CPerl Indentation after subs with print in their names 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

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=85zlx6qlid.fsf@usenet.my.skamphausen.de \
    --to=skampi@gmx.net \
    --cc=help-gnu-emacs@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.