all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Can't format my Perl code properly with cperl-mode
@ 2013-10-29  8:57 Pustovoyt Alexander
  2013-10-29 17:12 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Pustovoyt Alexander @ 2013-10-29  8:57 UTC (permalink / raw)
  To: help-gnu-emacs

   My problem is the same as the described in Emacs Wiki: Indenting Perl -
   Treating parentheses as blocks
   (http://www.emacswiki.org/emacs/IndentingPerl).

   е║

   I've got:

   е║

   sub _get_options

   {

   е║ return Getopt::Long::GetOptions(\%Options,

   е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║ qw(

   е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║ version|V

   е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║ )

   е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║е║ );

   }

   е║

   instead of desirable:

   е║

   sub _get_options

   {

   е║ return Getopt::Long::GetOptions(\%Options,

   е║е║е║ qw(

   е║е║е║е║е║ version|V

   е║е║е║ )

   е║ );

   }

   е║

   My ~/.emacs content is:

   е║

   (setq-default indent-tabs-mode nil)

   е║

   (defalias 'perl-mode 'cperl-mode)

   (setq-default

   е║cperl-indent-level 2

   е║cperl-indent-parens-as-block t

   е║cperl-tab-always-indent t

   е║cperl-continued-statement-offset 2

   е║cperl-continued-brace-offset -2

   е║cperl-close-paren-offset -2

   )

   е║

   е║

   I'm running GNU Emacs 24.3.1 with CPerl 6.2-Emacs.

   е║


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

* Re: Can't format my Perl code properly with cperl-mode
  2013-10-29  8:57 Pustovoyt Alexander
@ 2013-10-29 17:12 ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2013-10-29 17:12 UTC (permalink / raw)
  To: help-gnu-emacs

>    My problem is the same as the described in Emacs Wiki: Indenting Perl -
>    Treating parentheses as blocks
>    (http://www.emacswiki.org/emacs/IndentingPerl).

I assume your "е║" mean "space character".

>      return Getopt::Long::GetOptions(\%Options,
>                                      qw(
>                                          version|V
>                                          )
>                                      );

Have you tried to add a newline between "(" and "\%Options," ?


        Stefan




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

* Re: Can't format my Perl code properly with cperl-mode
@ 2013-10-30  8:04 Pustovoyt Alexander
  2013-10-31  1:28 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Pustovoyt Alexander @ 2013-10-30  8:04 UTC (permalink / raw)
  To: help-gnu-emacs

> Have you tried to add a newline between "(" and "\%Options," ?
So, I've tried, but the result wasn't something I'd like to see:
sub _get_options
{
  return Getopt::Long::GetOptions(
    \%Options,
    qw(
        version|V
        )
    );
}
Can Emacs be not so smart and allow me to format my code in my stupid way?


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

* Re: Can't format my Perl code properly with cperl-mode
  2013-10-30  8:04 Can't format my Perl code properly with cperl-mode Pustovoyt Alexander
@ 2013-10-31  1:28 ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2013-10-31  1:28 UTC (permalink / raw)
  To: help-gnu-emacs

>> Have you tried to add a newline between "(" and "\%Options," ?
> So, I've tried, but the result wasn't something I'd like to see:
> sub _get_options
> {
>   return Getopt::Long::GetOptions(
>     \%Options,
>     qw(
>         version|V
>         )
>     );
> }

That looks just like what I thought you wanted.
So, obviously, I'm missing something.


        Stefan




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

end of thread, other threads:[~2013-10-31  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-30  8:04 Can't format my Perl code properly with cperl-mode Pustovoyt Alexander
2013-10-31  1:28 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2013-10-29  8:57 Pustovoyt Alexander
2013-10-29 17:12 ` Stefan Monnier

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.