Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

Comment on perltidy, emacs, and PBP
Select or Download Code
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.

    emc

    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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://619774]
Approved by RMGir
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2014-12-18 02:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls