From: martin rudalics <rudalics@gmx.at>
To: "Александр Поляков" <izhitzza@comcast.net>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: Indentations, PERL
Date: Wed, 27 Jun 2007 10:00:36 +0200 [thread overview]
Message-ID: <46821924.2070608@gmx.at> (raw)
In-Reply-To: <4681F9E8.7070502@comcast.net>
> What I think is the bug, is a problem with automatic indentations when I
> type PERL programs. Let me get right to the point and I'll paste first
> the code how it is automatically indented:
>
> sub insert_sub {
> return unless (save_slide());
> my $after = 0;
>
> prompt(0, 'New Subtitle', "Would you like to " .
> "insert the new subtitle\n" .
> Next, is how I believe would be a proper way to indent the same code:
>
> sub insert_sub {
> return unless (save_slide());
> my $after = 0;
>
> prompt(0, 'New Subtitle', "Would you like to " .
> "insert the new subtitle\n" .
> "before the current one or after?",
> [{GTK_ID => 'gtk-cancel',
> LABEL => 'Cancel',
> ALIGN => 'right',
> SUB => sub { $after = -1;}},
> {GTK_ID => 'gtk-go-back',
> LABEL => 'Before',
> ALIGN => 'left',
> SUB => sub {$after = 0;}},
> {GTK_ID => 'gtk-go-forward',
> LABEL => 'After',
> ALIGN => 'right',
> SUB => sub {$after = 1}},
> ]);
>
> if ($after == 0) {
> insert_before($srt_idx);
> } elsif ($after == 1) {
> insert_before($srt_idx + 1);
> }
> }
>
> (Somehow the exact spacing differ here, but I think you can see the
> difference in general.)
>
> Basically after I enter "{... SUB => sub {}}," the indentation screws
> up. I hope this makes sense.
>
> Thanks,
> Alex.
>
>
> _______________________________________________
> bug-gnu-emacs mailing list
> bug-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs
>
next prev parent reply other threads:[~2007-06-27 8:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-27 5:47 Indentations, PERL Александр Поляков
2007-06-27 8:00 ` martin rudalics [this message]
2007-06-27 8:06 ` martin rudalics
[not found] ` <4684B476.1020007@comcast.net>
2007-06-29 7:55 ` martin rudalics
2007-06-29 13:42 ` Stefan Monnier
2007-06-29 13:56 ` martin rudalics
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46821924.2070608@gmx.at \
--to=rudalics@gmx.at \
--cc=bug-gnu-emacs@gnu.org \
--cc=izhitzza@comcast.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).