Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

perltidy, emacs, and PBP

by Anonymous Monk
on Jun 07, 2007 at 09:31 UTC ( #619774=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Recently I decided to abandon my long-held personal formatting standards and just follow perltidy/PBP. And also, due to curiosity about the recent 22 release of Emacs, promised myself to try to use Emacs more :-)

{Tips, Emacs rc file, Whatever} to make cperl-mode behave more closely to PBP would be appreciated. Being a clueless newbie Emacs user, I don't even know how to set the continuation indentation (exact term?), you know, the "z" in code below:

$mech->submit_form( zzzzform_number => 1, zzzzfields => { zzzzzzzzusername => ... zzzzzzzzpassword => ... zzzz}, );

By default, cperl-mode behaves like this:

$mech->submit_form( zzzzzzzzzzzzzzzzzzzzform_number => 1, zzzzzzzzzzzzzzzzzzzzfields => { zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzusername => ... zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzpassword => ... zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz}, zzzzzzzzzzzzzzzzzzz);

Edit: g0n - replaced pre tags with code tags

Replies are listed 'Best First'.
Re: perltidy, emacs, and PBP
by strat (Canon) on Jun 07, 2007 at 10:25 UTC

    maybe my .emacs helps you; it runs (with adopted paths) unter windows, linux and solaris:

Re: perltidy, emacs, and PBP
by swampyankee (Parson) on Jun 07, 2007 at 14:27 UTC

    A lot of these can be set by M-x custom.

    Some ambitious emacs lisper (hint, hint) should consider integrating PBP's formatting suggestions into cperl-mode. I've only read snippets of PBP, and find perltidy's defaults less than pleasant, but standards–even ones with which I don't entirely agree–are usually a good thing.


    Any New York City or Connecticut area jobs? I'm currently unemployed.

    There are some enterprises in which a careful disorderliness is the true method.

    —Herman Melville
Re: perltidy, emacs, and PBP
by educated_foo (Vicar) on Jun 07, 2007 at 16:46 UTC
    I get what seems to be your desired behavior from these:
    (cperl-set-style "BSD") (setq cperl-indent-parens-as-block t cperl-close-paren-offset -4)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://619774]
Approved by RMGir
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2017-08-23 08:40 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (350 votes). Check out past polls.